OpenStack Queens版儲存庫無法使用問題
阿新 • • 發佈:2018-12-05
自從CentOS7.5更新以後,CentOS7.4以及CentOS7.5都出現儲存庫無法使用的問題,具體如下:
執行以下命令安裝OpenStack儲存庫
[root@localhost ~]# yum install centos-release-openstack-queens
導致CentOS源無法使用,報錯資訊如下:
[root@localhost ~]# yum makecache
Loaded plugins: fastestmirror
base | 3.6 kB 00:00:00
centos-ceph-luminous | 2.9 kB 00:00:00
centos-openstack-queens | 2.9 kB 00:00:00
http://mirror.centos.org/%24contentdir/7/virt/x86_64/kvm-common/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below wiki article
https://wiki.centos.org/yum-errors
If above article doesn't help to resolve this issue please use https://bugs.centos.org/.
One of the configured repositories failed (CentOS-7 - QEMU EV),
and yum doesn' t have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=centos-qemu-ev ...
4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable centos-qemu-ev
or
subscription-manager repos --disable=centos-qemu-ev
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=centos-qemu-ev.skip_if_unavailable=true
failure: repodata/repomd.xml from centos-qemu-ev: [Errno 256] No more mirrors to try.
http://mirror.centos.org/$contentdir/7/virt/x86_64/kvm-common/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
google找到如下解決辦法,說是bug:
https://www.spinics.net/lists/centos-virt/msg05150.html
其中CentOS-QEMU-EV.repo檔案存在問題,替換為舊檔案問題解決,舊檔案分享:
連結: https://pan.baidu.com/s/1He02ZQQiCn4kpAiyoQCQ7w 密碼: k3hh
[root@localhost ~]# ll /etc/yum.repos.d/
total 48
-rw-r--r--. 1 root root 1664 Aug 30 2017 CentOS-Base.repo
-rw-r--r-- 1 root root 1095 Sep 21 2017 CentOS-Ceph-Luminous.repo
-rw-r--r--. 1 root root 1309 Aug 30 2017 CentOS-CR.repo
-rw-r--r--. 1 root root 649 Aug 30 2017 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 314 Aug 30 2017 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 630 Aug 30 2017 CentOS-Media.repo
-rw-r--r-- 1 root root 1186 Feb 27 18:08 CentOS-OpenStack-queens.repo
-rw-r--r-- 1 root root 509 Jun 4 17:17 CentOS-QEMU-EV.repo
-rw-r--r--. 1 root root 1331 Aug 30 2017 CentOS-Sources.repo
-rw-r--r--. 1 root root 3830 Aug 30 2017 CentOS-Vault.repo
-rw-r--r--. 1 root root 2142 Jul 24 2017 elrepo.repo
可以使用命令對比檢視不一樣的內容,問題可能出在contentdir上
[[email protected] ~]# diff -u CentOS-QEMU-EV.repo.old CentOS-QEMU-EV.repo
--- CentOS-QEMU-EV.repo.old 2018-06-04 17:17:04.535241765 +0800
+++ CentOS-QEMU-EV.repo 2018-05-10 22:33:42.000000000 +0800
@@ -5,7 +5,7 @@
[centos-qemu-ev]
name=CentOS-$releasever - QEMU EV
-baseurl=http://mirror.centos.org/centos/$releasever/virt/$basearch/kvm-common/
+baseurl=http://mirror.centos.org/$contentdir/$releasever/virt/$basearch/kvm-common/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization
也可以更換為fedora rdo源,但是使用這個源搭建到keystone時報錯,不知道什麼原因:
# wget https://repos.fedorapeople.org/repos/openstack/openstack-queens/rdo-release-queens-1.noarch.rpm
# rpm –ivh rdo-release-queens-1.noarch.rpm
報錯資訊如下:
[root@controller ~]# openstack token issue
Failed to discover available identity versions when contacting http://controller:5000/v3. Attempting to parse version from URL.
Internal Server Error (HTTP 500)
檢視keystone日誌