二、本地仓库搭建(本地仓库为172.16.172.17服务器,以下操作都在这台设备上进行)
1.准备下载文件
a.Ambari
下载包:wget http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.5.0.3/ambari-2.5.0.3-centos7.tar.gz
ambari.repo:wget http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.5.0.3/ambari.repo
b.HDP
下载包:wget http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.0.3/HDP-2.6.0.3-centos7-rpm.tar.gz
hdp.repo:wget http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.0.3/hdp.repo
c.HDP-UTILS
下载包:wget http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.21/repos/centos7/HDP-UTILS-1.1.0.21-centos7.tar.gz
2.开启apache http服务:
(1)安装:yum install httpd -y
(2)将Apache服务添加到 开机自启中
(3)打开firefox浏览器 测试http://172.16.172.17
3.设置yun安装源校验
(1)在ambari.server上执行:
# yum install -y yum-plugin-priorities
(2)修改Yum安装源的校验
# vi /etc/yum/pluginconf.d/priorities.conf
#设置为以下内容
[main]
enabled=1
gpgcheck=0
4.创建本地仓库目录
(1)在根目录下创建/var/www/html/,
(2)解压文件:
tar -zxvf ambari-2.5.0.3-centos7.tar.gz;
tar -zxvf HDP-2.6.0.3-centos7-rpm.tar.gz;
tar -zxvf HDP-UTILS-1.1.0.21-centos7.tar.gz;
(3)将解压后的文件放到html文件夹下。
5.制作本地仓库资源文件
(1)创建Ambari、HDP、HDP-UTIL资源文件:
ambari.repo:
#VERSION_NUMBER=2.5.0.3-7
[ambari-2.5.0.3]
name=ambari Version - ambari-2.5.0.3
baseurl=http://172.16.172.17/ambari/centos7/2.x/updates/2.5.0.3
gpgcheck=0
gpgkey=http://172.16.172.17/ambari/centos7/2.x/updates/2.5.0.3/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
hdp.repo
#VERSION_NUMBER=2.6.0.3-8
[HDP-2.6.0.3]
name=HDP Version - HDP-2.6.0.3
baseurl=http://172.16.172.17/hdp/HDP/centos7
gpgcheck=0
gpgkey=http://172.16.172.17/hdp/HDP/centos7/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
[HDP-UTILS-1.1.0.21]
name=HDP-UTILS Version - HDP-UTILS-1.1.0.21
baseurl=http://172.16.172.17/hdp/HDP-UTILS-1.1.0.21/repos/centos7
gpgcheck=0
gpgkey=http://172.16.172.17/hdp/HDP/centos7/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
(2)制作完成后,移动到/etc/yum.repos.d/;
(3)依次执行以下命令,更新本地资源池:
# yum clean plugins # yum update # yum makecache 等待更新完毕后,查看资源池: # yum repolist 如果看到以下资源,表示配置成功:
5.检验
输入http://172.16.172.17/hdp确保能看到文件。