1. 下载下面的包html
wget http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.7.3.0/ambari.repo wget http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.7.3.0/ambari-2.7.3.0-centos7.tar.gz wget http://public-repo-1.hortonworks.com/HDP/centos7/3.x/updates/3.1.0.0/hdp.repo wget http://public-repo-1.hortonworks.com/HDP/centos7/3.x/updates/3.1.0.0/HDP-3.1.0.0-centos7-rpm.tar.gz wget http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.22/repos/centos7/HDP-UTILS-1.1.0.22-centos7.tar.gz wget http://public-repo-1.hortonworks.com/HDP-GPL/centos7/3.x/updates/3.1.0.0/HDP-GPL-3.1.0.0-centos7-gpl.tar.gz
我用的是 CentOS7 的系统,其它系统的下载连接请参考:web
https://docs.hortonworks.com/HDPDocuments/Ambari-2.7.3.0/bk_ambari-installation/content/hdp_31_repositories.htmlvim
https://docs.hortonworks.com/HDPDocuments/Ambari-2.7.3.0/bk_ambari-installation/content/ambari_repositories.htmlcentos
2. 安装建立本地库须要的工具浏览器
yum -y install yum-utils createrepo
3. 建立 HTTP 服务服务器
yum -y install httpd
/sbin/chkconfig httpd on
/sbin/service httpd start
在浏览器里访问安装 HTTP 服务的主机,查看是否成功。如: http://192.168.242.21工具
4. 建立 web 服务的目录oop
mkdir -p /var/www/html/
5. 解压下载的 ambari-2.7.3.0-centos7.tar.gz ,把整个解压后的文件夹移至 第4步建立的目录中。url
6. 在第4步建立的目录下,建立 hdp 的目录, 并把上面下载的 HDP 开头的 .tar.gz 包都解压到这个目录。centos7
mkdir /var/www/html/hdp
tar -zxvf <PATH> -C <PATH>
7. 确承认以经过浏览器访问到 http://192.168.242.181/ambari/
若是不能访问,要开启下面的策略
iptables -I INPUT -p TCP --dport 80 -j ACCEPT
8. 使用 ambari 部署 hadoop 集群时,须要在集群的每台机器上下载相关的安装包。为了使用上面配置的 web 服务作为 yum 的源(即安装包从上面配置的 web 服务器上下载),须要在集群的每台机器上作以下的配置
yum -y install yum-plugin-priorities vim /etc/yum/pluginconf.d/priorities.conf
priorities.conf 的内容以下:
[main] enabled=1 gpgcheck=0
把下载的 ambari.repo 放到 /etc/yum.repos.d/ 目录里。编辑此文件,把其中 baseurl 的值改为 web 服务目录下 ambari/<OS>/<version>。例如:
baseurl=http://192.168.242.181/ambari/centos7/2.7.3.0-139