解压tar.gz文件到指定目录
tar -zxvf ambari-2.7.5.0-centos7.tar.gz -C /data/a_yum
安装httpd、createrepo
yum install httpd createrepo
查看结果:
修改httpd的配置文件,指定数据路径
vi /etc/httpd/conf/httpd.conf
注意:
1、可以自定义,更换目录.需要改以上3处,不然报错403
2、修改“#ServerName www.example.com:80”“#,改为ServerName localhost
启动httpd
systemctl start httpd
创建yum源仓库
cd /data/a_yum/ambari/centos7/2.7.5.0-72/
createrepo .
备注:
createrepo 后需要加路径,上述命令最后的".",表示当前路径,不可缺少,否则会报错。命令执行后,会在当前路径下生成repodata文件夹
创建repo文件
cd /etc/yum.repos.d
vi ambari.repo
[ambari-2.7.5.0]
name=ambari-2.7.5
baseurl=http://{host_ip}/ambari/centos7/2.7.5.0-72
enabled=1
gpgcheck=0
priority=1
gpgkey=http://{host_ip}/ambari/centos7/2.7.5.0-72/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
说明:
baseurl可以在浏览器中验证是否能够正常访问。
生效源地址
清空:yum clean all
生成缓存:yum makecache
查看repo列表
yum repolist



