您的位置:首页 > 运维架构 > Apache

离线安装 Apache Ambari

2016-02-27 13:38 549 查看


需要说明一下,这里安装的ambari是支持hadoop 1.2.1版本的,而对于比较流行的新版本,比如2.0,你需要下载新的源码包.不过总的来说,安装过程是大同小异的。


Step 1 获得相关源码

Ambari 依赖一些程序,为此需要先下载这些源码。注意,我们使用的环境是 CentOS 6,因此,你的操作系统若不是
CentOS 6,那么需要下载支持相应系统的软件包。

在联网状态下,可以使用 wget 命令获得 Ambari 所需的程序包。

HDP Repository
wget http://public-repo-1.hortonworks.com/HDP/centos6/HDP-1.3.0.0-centos6-rpm.tar.gz


HDP-Utils Repository
wget http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.15/repos/centos6/HDP-UTILS-1.1.0.15-centos6-rpm.tar.gz


Ambari Repository
wget http://public-repo-1.hortonworks.com/ambari/centos6/ambari-1.2.4.9-centos6.tar.gz


Step 2 配置安装包文件

当这些文件下载后,将这些压缩包的文件解压到 /var/www/html 中,为了方便管理我们建议在该目录下创建一个 external,将这些不是CentOS系统自带的安装包都放在这个目录中。

使用tar命令解压缩:
mkdir -p /var/www/html/external
tar -xvf ./HDP-1.3.0.0-centos6-rpm.tar.gz -C /var/www/html/external/
tar -xvf ./HDP-UTILS-1.1.0.15-centos6-rpm.tar.gz -C /var/www/html/external/
tar -xvf ./ambari-1.2.4.9-centos6.tar.gz -C /var/www/html/external/


之后,在/etc/yum.repos.d创建三个repo文件

ambari.repo
[ambari-1.x]
name=Ambari 1.x
baseurl=http://ISCASTest01/external/ambari/centos6/1.x/updates/1.2.4.9
gpgcheck=1
gpgkey=http://ISCASTest01/external/ambari/centos6/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1

[HDP-UTILS-1.1.0.15]
name=Hortonworks Data Platform Utils Version - HDP-UTILS-1.1.0.15
baseurl=http://ISCASTest01/external/HDP-UTILS-1.1.0.15/repos/centos6
gpgcheck=0
gpgkey=http://ISCASTest01/external/ambari/centos6/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1

[Updates-ambari-1.2.4.9]
name=ambari-1.2.4.9 - Updates
baseurl=http://ISCASTest01/external/ambari/centos6/1.x/updates/1.2.4.9
gpgcheck=1
gpgkey=http://ISCASTest01/external/ambari/centos6/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1


hdp.repo
[HDP-1.3.0.0]
name=Hortonworks Data Platform Version - HDP-1.3.0.0
baseurl=http://ISCASTest01/external/HDP/centos6/1.x/GA/1.3.0.0
gpgcheck=1
gpgkey=http://ISCASTest01/external/HDP/centos6/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1

[HDP-UTILS-1.1.0.15]
name=Hortonworks Data Platform Utils Version - HDP-UTILS-1.1.0.15
baseurl=http://ISCASTest01/external/HDP-UTILS-1.1.0.15/repos/centos6
gpgcheck=1
gpgkey=http://ISCASTest01/external/HDP/centos6/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1


hdp-util.repo
[HDP-UTILS-1.1.0.15]
name=Hortonworks Data Platform Version - HDP-UTILS-1.1.0.15
baseurl= http://ISCASTest01/external/HDP-UTILS-1.1.0.15/repos/centos6 gpgcheck=1
enabled=1
priority=1


之后,将写好的文件,发送至其他节点上
scp ambari.repo root@ISCASTest02:/etc/yum.repo.d/
scp hdp.repo root@ISCASTest02:/etc/yum.repo.d/
scp hdp-util.repo root@ISCASTest02:/etc/yum.repo.d/

scp ambari.repo root@ISCASTest03:/etc/yum.repo.d/
scp hdp.repo root@ISCASTest03:/etc/yum.repo.d/
scp hdp-util.repo root@ISCASTest03:/etc/yum.repo.d/


安装 Ambari

将仓库文件发送至各节点后,在各节点需要运行 yum clean all 以清空缓存文件,为了检验文件是否配置正确,可以使用
yum search ambari-agent, yum search Oozie, yum search gangli。如果配置有问题,就会出现找不到文件包的问题。

之后,在主节点运行
yum install ambari-server


在其他节点上运行
yum install ambari-agent


之后,在主节点上,运行命令:
ambari-server start


如果报错:
ERROR: No JDK found, please run the "setup" command to install a JDK automatically or install any JDK manually to /usr/jdk64


出现这样的问题的原因,要么是主机上没有安装JAVA,要么就是主机上的JAVA版本与ambari的要求不一致。如果联网环境中,可以运行命令:
ambari-server setup


如果主机上已经安装了JAVA了,而使用ambari-server setup继续报错,那么也可以把JAVA_HOME的地址配置到ambari中,例如:
ambari-server setup -j /usr/java/jdk1.8.0_05/


不过,默认的JDK版本是1.6,所以最好在集群各个节点上都安装同样版本的JDK。

输出:
Using python  /usr/bin/python2.6
Initializing ...
Setup ambari-server
Checking SELinux...
SELinux status is 'enabled'
SELinux mode is 'permissive'
WARNING: SELinux is set to 'permissive' mode and temporarily disabled. You should disable SELinux permanently.
OK to continue [y/n] (y)? y
Checking iptables...
iptables is disabled now
Checking JDK...
WARNING: JAVA_HOME /usr/java/jdk1.8.0_05/ must be valid on ALL hosts
Completing setup...
Configuring database...
Enter advanced database configuration [y/n] (n)? y
Select database:
1 - Postgres(Embedded)
2 - Oracle
[1]:
Database Name [ambari]:
Username [ambari]:
Password [bigdata]:
Default properties detected. Using built-in database.
Checking PostgreSQL...
Running initdb: This may take upto a minute.
About to start PostgreSQL
Configuring database...
Configuring PostgreSQL...
Restarting PostgreSQL
Ambari Server 'setup' finished successfully


之后再次使用命令 ambari-server start 启动设备


启动 Ambari

打开浏览器,输入地址:
http://localhost:8080


就可以看到登录界面了:
user: admin
password admin


第一次启动会出现一个配置向导,这时就可以按照自己的需要进行配置了。

转载:http://blog.csdn.net/poisonchry/article/details/37726663
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: