真的是几经周折,终于配置好了!我做好了一键配置yum的代码,地址:https://www.cnblogs.com/guarding/p/12321702.html
首先看一下配置前的报错信息把:
需要安装以下安装包(根据openstack-ocata的官方文档:https://docs.openstack.org/ocata/install-guide-rdo/environment-packages.html)
# yum install centos-release-openstack-ocata
# yum install python-openstackclient
[root@node1 ~]# yum install centos-release-openstack-ocata
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
base | 3.6 kB 00:00:00
centos | 3.6 kB 00:00:00
epel | 5.3 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/2): epel/x86_64/updateinfo | 1.0 MB 00:00:00
(2/2): epel/x86_64/primary_db | 6.7 MB 00:00:02
没有可用软件包 centos-release-openstack-ocata。
错误:无须任何处理
[root@node1 ~]# yum install python-openstackclient
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
没有可用软件包 python-openstackclient。
错误:无须任何处理
解决方案:
1.首先配置好本机的DNS(DNS谁的都可以一样,依次是谷歌的、腾讯的、阿里云的,反正都配置了肯定没错,少配置了可能会遇到问题)
[root@node1 ~]# echo "nameserver 8.8.8.8
nameserver 119.29.29.29
nameserver 114.114.114.114" > /etc/resolv.conf
[root@node1 ~]# cat /etc/resolv.conf
nameserver 8.8.8.8
nameserver 119.29.29.29
nameserver 114.114.114.114
#配置openstack的yum源
[root@node1 ~]# tar -zcf /etc/yum.repos.d/yum.repo.bak.gz /etc/yum.repos.d/*
[root@node1 ~]# rm -rf /etc/yum.repos.d/CentOS-*
[root@node1 ~]# wget -O /etc/yum.repos.d/CentOS-epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
[root@node1 ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@node1 ~]# sed -i '$a /dev/cdrom /mnt/ iso9660 defaults 0 0' /etc/fstab #如果你没有连接光盘镜像此步骤可以不做,基本没影响
[root@node1 ~]# mount -a
[root@node1 ~]# tee /etc/yum.repos.d/CentOS-7.repo <<-'EOF'
[centos]
name=centos7
baseurl=file:///mnt/
enable=1
gpgcheck=0
EOF
2.安装openstack-ocata所需要的依赖包(阿里云的各种源地址:https://developer.aliyun.com/mirror/)
[root@node1 ~]# yum -y install centos-release-ceph-jewel centos-release-qemu-ev
通过阿里云下载centos-release-openstack-ocata
[root@node1 ~]# wget -O /opt/centos-release-openstack-ocata-1-2.el7.noarch.rpm https://mirrors.aliyun.com/centos-vault/altarch/7.6.1810/extras/ppc64le/Packages/centos-release-openstack-ocata-1-2.el7.noarch.rpm?spm=a2c6h.13651111.0.0.25962f70kIQliu&file=centos-release-openstack-ocata-1-2.el7.noarch.rpm
[root@node1 ~]# wget -O /opt/rdo-release-ocata-3.noarch.rpm https://repos.fedorapeople.org/repos/openstack/EOL/openstack-ocata/rdo-release-ocata-3.noarch.rpm
安装openstack存储库
[root@node1 ~]# rpm -ivh /opt/centos-release-openstack-ocata-1-2.el7.noarch.rpm
[root@node1 ~]# rpm -ivh /opt/rdo-release-ocata-3.noarch.rpm
删除两个有错误的yum,避免后面出错
[root@node1 ~]# rm -rf /etc/yum.repos.d/CentOS-OpenStack-ocata.repo
[root@node1 ~]# rm -rf /etc/yum.repos.d/rdo-qemu-ev.repo
添加一个测试好的openstack-ocata源
[root@node1 ~]# tee /etc/yum.repos.d/CentOS-ocata.repo <<-'EOF'
> [openstack]
> name=ocata
> baseurl=https://buildlogs.cdn.centos.org/centos/7/cloud/x86_64/openstack-ocata/
> enable=1
> gpgcheck=0
> EOF
[root@node1 ~]# yum clean all #清空yum缓存
[root@node1 ~]# yum repolist
[root@node1 ~]# yum makechahe #更新yum缓存资源
至此openstack的yum源已经配置成功,搜集这些源确实不容易,我做的这个是针对openstack的ocata版本的,其他版本方法基本一样,
如地址可以改一下尝试能不能搜到:https://buildlogs.cdn.centos.org/centos/7/cloud/x86_64/openstack-ocata/
再次执行yum install centos-release-openstack-ocata,发现已经安装成功
[root@node1 ~]# yum install centos-release-openstack-ocata
已加载插件:fastestmirror, langpacks
Repository openstack-ocata is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
无须任何处理
执行yum install python-openstackclient也可以完美的安装了,这些步骤前提条件是网络没啥问题!
[root@node1 ~]# yum install python-openstackclient
已加载插件:fastestmirror, langpacks
Repository openstack-ocata is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
软件包 python-openstackclient-3.8.2-1.el7.noarch 已安装并且是最新版本
无须任何处理