1,首先下载openstack ocata、ceph、qemu kvm的包
# mkdir /opt/ocata
# wget -np -nH –cut-dirs=1 -r -c -L –exclude-directories=repodata –accept=rpm,gz,xml http://mirror.centos.org/centos/7/cloud/x86_64/openstack-ocata/ -P /opt/ocata
# wget -np -nH –cut-dirs=1 -r -c -L –exclude-directories=repodata –accept=rpm,gz,xml http://mirror.centos.org/centos/7/virt/x86_64/kvm-common/ -P /opt/ocata
# wget -np -nH –cut-dirs=1 -r -c -L –exclude-directories=repodata –accept=rpm,gz,xml http://mirror.centos.org/centos/7/storage/x86_64/ceph-jewel/ -P /opt/ocata
wget参数介绍:
-r,–recursive 下载整个网站、目录
-nH, –no-host-directories 不创建主机目录
-P, –directory-prefix=PREFIX 将文件保存到目录PREFIX/…
–cut-dirs=NUMBER 忽略 NUMBER层远程目录
-k, –convert-links 转换非相对链接为相对链接
-I, –include-directories=LIST 允许目录的列表
-X, –exclude-directories=LIST 不被包含目录的列表
-np, –no-parent 不要追溯到父目录
-A, –accept=LIST 分号分隔的被接受扩展名的列表
-R, –reject=LIST 分号分隔的不被接受的扩展名的列表
-c, –continue 接着下载没下载完的文件
-L, –relative 仅仅跟踪相对链接
2,创建repodata
# yum install createrepo yum-plugin-fastestmirror yum-plugin-priorities -y
# createrepo -p -d -o /opt/ocata /opt/ocata
3,配置http服务器,将根目录指到/opt/ocata
# yum install -y httpd
# rm -rf /var/www/html
# ln -s /opt/ocata /var/www/html
# systemctl start httpd && systemctl enable httpd
4,浏览器访问验证:http://10.62.10.240/centos/
5,重新弄下yum源
# cd /etc/yum.repos.d/
# mkdir bak
# mv * bak
# curl -O http://mirrors.aliyun.com/repo/Centos-7.repo
# curl -O http://mirrors.aliyun.com/repo/epel-7.repo
6,创建rdo-release.repo文件
# vi /etc/yum.repos.d/rdo-release.repo
[openstack-ocata]
name=OpenStack ocata Repository
baseurl=http://10.62.10.240/
enabled=1
priority=1
gpgcheck=0
7,把rdo-release.repo文件传到客户端的/etc/yum.repos.d/目录下即可
# yum clean all