1. 安装yum utilities
yum install -y yum-utils createrepo
2. 创建 repository 文件夹
mkdir -p /var/www/html/
3. cd /var/www/html
4. mkdir -p ambari/centos7
5. 下载 repo file 并且 确认 repository 可用
Ambari :wget -nv http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.2.2/ambari.repo -O /etc/yum.repos.d/ambari.repo
ambari repo name must be ”ambari.repo“, otherwise
will throw out error when registering hosts into cluster
HDP :wget -nv http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.5.0/hdp.repo -O /etc/yum.repos.d/hdp-2.6.5.0.repo
HDP-GPL:wget -nv http://public-repo-1.hortonworks.com/HDP-GPL/centos6/2.x/updates/2.6.5.0/hdp.gpl.repo -O /etc/yum.repos.d/hdp.gpl-2.6.5.0.repo
HDF :wget -nv http://public-repo-1.hortonworks.com/HDF/centos7/3.x/updates/3.1.0.0/hdf.repo -O /etc/yum.repos.d/hdf-3.1.0.0.repo
执行 yum repolist,确保ambari,hdp,hdp-gpl,hdf 出现
6. 创建Ambari本地仓库
cd /var/www/html/ambari/centos7
reposync -r ambari-2.6.2.2
cd /var/www/html/ambari/centos7/ambari-2.6.2.2
createrepo .
修改 Ambari repo 文件:替换baseurl为本地位置:
baseurl=http://114.115.141.93/ambari/centos7/ambari-2.6.2.2/
7. 创建hdp本地仓库
cd /var/www/html/
mkdir -p hdp/centos7
cd hdp/centos7
reposync -r HDP-2.6.5.0
reposync -r HDP-UTILS-1.1.0.22
reposync -r HDP-GPL-2.6.5.0
cd /var/www/html/hdp/centos7/HDP-2.6.5.0
createrepo .
cd /var/www/html/hdp/centos7/HDP-UTILS-1.1.0.22
createrepo .
cd /var/www/html/hdp/centos7/HDP-GPL-2.6.5.0
createrepo .
修改repo 文件的base url,使其指定到本地 repository
8. 创建hdf本地仓库
cd /var/www/html/
mkdir -p hdf/centos7
cd hdf/centos7
reposync -r HDF-3.1.0.0
cd /var/www/html/hdf/centos7/HDF-3.1.0.0
createrepo .
cd /var/www/html/hdp/centos7/
reposync -r HDP-UTILS-1.1.0.21
cd /var/www/html/hdp/centos7/HDP-UTILS-1.1.0.21
createrepo .
修改repo base url:
9. edit /etc/yum/pluginconf.d/priorities.conf, 内容如下
[main]
enabled=1
gpgcheck=0