真的是幾經周折,終於配置好了!我做好了一鍵配置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 已安裝並且是最新版本
無須任何處理