安装 Ambari,最后是为了用它部署 hadoop 集群。安装时默认使用的是 hortonworks 远程的资源,用它部署集群时,需要下载 Hadoop、Hive、HBase 的安装包,速度很慢。我部署时,老是失败。所以按照官方文档,建一个本地资源库。预先下载好包,放在一台电脑上,然后把这台电脑配置成 repository。
1. 下载下面的包
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 的系统,其它系统的下载链接请参考:
https://docs.hortonworks.com/HDPDocuments/Ambari-2.7.3.0/bk_ambari-installation/content/hdp_31_repositories.html
https://docs.hortonworks.com/HDPDocuments/Ambari-2.7.3.0/bk_ambari-installation/content/ambari_repositories.html
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 服务的目录
mkdir -p /var/www/html/
5. 解压下载的 .tar.gz 文件至 第4步创建的目录中。
6. 使用 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
7. 把下载的 ambari.repo 放到 /etc/yum.repos.d/ 目录里。编辑此文件,把其中 baseurl 的值改成 web 服务目录下 ambari/<OS>/<version>。例如:
baseurl=http://192.168.7.132/ambari/centos7/2.7.3.0-139
从零开始安装 Ambari (2) -- 准备本地 repository
原文:https://www.cnblogs.com/langfanyun/p/10368140.html