本地源yum方式下Ambari的安装与配置
1、 准备工作
1.1注意
接下来的内容默认是在设备的基本配置正确的前提下进行的,具体配置如下:
a) 机器已经正确安装统一的centos系统(最好提前装好jdk、httpd等)
b) 机器正确修改了主机名以及主机名与ip的映射
c) 机器之前配置了ssh免密码登陆
d) 各设备之间网络连接正确并关闭防火墙
e) 需要统一各设备节点上的时间
b,c两条可参考《全分布式Hadoop安装机器环境配置》文档中4.1和4.4两小节,e可
参考《ntp本地服务器搭建》文档
1.2步骤
本地源离线方式下Ambari的安装配置主要分为三大部分:
a)下载所需的三个源文件
ambari-2.2.2.0-centos7.tar.gz
HDP-2.4.2.0-centos7-rpm.tar.gz
HDP-UTILS-1.1.0.20-centos7.tar.gz
yum下载时候的根路径是/var/www/html(这个可以在/etc/httpd/conf/httpd.conf文件中修改配置),我们这次将上述三个源文件解压至/var/www/html/external目录下,yum获取的本地源地址类似于http://dcom-node2/external/........
b)配置相关内容
本地源配置、相关服务启动等等
c)安装ambari和相关组件
在设备上安装ambari和其他组件
2、 本地源的配置
在/etc/yum.repos.d目录下增加 ambary.repo、hdp.repo、hdp-until.repo三个文件、修改
CentOS-Base.repo文件(不修改也备份它,以防yum下载源干扰)。
首先需要启动httpd服务service httpd start
ambari.repo
[ambari-2.x] name=Ambari 2.x baseurl=http://dcom-node2/external/AMBARI-2.2.2.0/centos7/2.2.2.0-460 gpgcheck=0 gpgkey=http://dcom-node2/external/AMBARI-2.2.2.0/centos7/2.2.2.0-460/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins enabled=1 priority=1
[Updates-ambari-2.2.2.0] name=ambari-2.2.2.0 - Updates baseurl=http://dcom-node2/external/AMBARI-2.2.2.0/centos7/2.2.2.0-460 gpgcheck=0 gpgkey=http://dcom-node2/external/AMBARI-2.2.2.0/centos7/2.2.2.0-460/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins enabled=1 priority=1 |
hdp.repo
[HDP-2.4.2.0] name=Hortonworks Data Platform Version - HDP-2.4.2.0 -Updates baseurl=http://dcom-node2/external/HDP/centos7/2.x/updates/2.4.2.0/ gpgcheck=1 gpgkey=http://dcom-node2/external/HDP/centos7/2.x/updates/2.4.2.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins enabled=1 priority=1 |
hdp-until.repo
[HDP-UTILS-1.1.0.20] name=Hortonworks Data Platform Version - HDP-UTILS-1.1.0.20 baseurl=http://dcom-node2/external/HDP-UTILS-1.1.0.20/repos/centos7 gpgcheck=1 enabled=1 priority=1 |
注意:
上文方框中的baseurl可以在浏览器中检验是否正确,如下图:
另外安装时需要用到linux的对应镜像,所以我的安装将镜像拷到了本地的
/var/www/html/centos目录下,其他的主机也可以通过mount形式挂载被挂载的主机需要开启nfs服务,另外在/etc/exports文件中指明可被挂载的目录的目的主机ip或者在/etc/httpd/conf/httpd.conf中修改httpd的配置
具体挂载命令:
mount -t nfs -onolock dcom-node2:/var/www/html/centos/ /var/www/html/centos/
上面挂载目录的方式是可选的,本人建议通过修改CentOS-Base.repo:来获取centos镜
像注释掉网上的链接,让yum从本地源去下载centos镜像。
# CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # #
[base] name=CentOS-$releasever - Base #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ #gpgcheck=1 baseurl=http://dcom-node2/centos/CentOS_6.7_Final gpgcheck=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#released updates [updates] name=CentOS-$releasever - Updates #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ #gpgcheck=1 baseurl=http://dcom-node2/centos/CentOS_6.7_Final gpgcheck=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful [extras] name=CentOS-$releasev |