今回行っていること
「Packstack」と呼ばれるOpenStackのインストールツールを使って、CentOS7.9にOpenStackクラウドを構築する。
問題点
実施環境
VirtualBox 仮想マシン
アダプタ「ブリッジ」
OS「CentOS 7.9」
「最初の数回はyumコマンドを正常に実行できるが、その後実行できなくなる」
具体的な事象
【/etc/yum.repos.d/CentOS-Base.repoの書き換え】
「/etc/yum.repos.d/CentOS-Base.repo」のファイルを以下のサイトを参考に書き換える。
書き換えた際の記録は「参考サイトを元に対処した記録」に記載
【パッケージのアップデート】
yum update -y
実行結果最後の部分を抜粋
xz.x86_64 0:5.2.2-2.el7_9
xz-libs.x86_64 0:5.2.2-2.el7_9
zlib.x86_64 0:1.2.7-21.el7_9
完了しました!
【インストール可能なOpenStackバージョンを確認】
yum search centos-release-openstack
読み込んだプラグイン:fastestmirror
Loading mirror speeds from cached hostfile
======================== N/S matched: centos-release-openstack ========================
centos-release-openstack-queens.noarch : OpenStack from the CentOS Cloud SIG repo
: configs
centos-release-openstack-rocky.noarch : OpenStack from the CentOS Cloud SIG repo
: configs
centos-release-openstack-stein.noarch : OpenStack from the CentOS Cloud SIG repo
: configs
centos-release-openstack-train.noarch : OpenStack from the CentOS Cloud SIG repo
: configs
Name and summary matches only, use "search all" for everything.
【バージョンsteinパッケージのインストール】
yum install -y centos-release-openstack-stein
(4/6): centos-release-storage-common-2-2.el7.centos.noarch.rpm | 5.1 kB 00:00:00
(5/6): centos-release-virt-common-1-1.el7.centos.noarch.rpm | 4.5 kB 00:00:00
(6/6): centos-release-qemu-ev-1.0-4.el7.centos.noarch.rpm | 11 kB 00:00:00
---------------------------------------------------------------------------------------
合計 270 kB/s | 35 kB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
インストール中 : centos-release-storage-common-2-2.el7.centos.noarch 1/6
インストール中 : centos-release-nfs-ganesha28-1.0-3.el7.centos.noarch 2/6
インストール中 : centos-release-ceph-nautilus-1.2-2.el7.centos.noarch 3/6
インストール中 : centos-release-virt-common-1-1.el7.centos.noarch 4/6
インストール中 : centos-release-qemu-ev-1.0-4.el7.centos.noarch 5/6
インストール中 : centos-release-openstack-stein-1-1.el7.centos.noarch 6/6
検証中 : centos-release-openstack-stein-1-1.el7.centos.noarch 1/6
検証中 : centos-release-virt-common-1-1.el7.centos.noarch 2/6
検証中 : centos-release-ceph-nautilus-1.2-2.el7.centos.noarch 3/6
検証中 : centos-release-nfs-ganesha28-1.0-3.el7.centos.noarch 4/6
検証中 : centos-release-storage-common-2-2.el7.centos.noarch 5/6
検証中 : centos-release-qemu-ev-1.0-4.el7.centos.noarch 6/6
インストール:
centos-release-openstack-stein.noarch 0:1-1.el7.centos
依存性関連をインストールしました:
centos-release-ceph-nautilus.noarch 0:1.2-2.el7.centos
centos-release-nfs-ganesha28.noarch 0:1.0-3.el7.centos
centos-release-qemu-ev.noarch 0:1.0-4.el7.centos
centos-release-storage-common.noarch 0:2-2.el7.centos
centos-release-virt-common.noarch 0:1-1.el7.centos
完了しました!
【PackStackパッケージのインストール】ここでエラー
yum install -y openstack-packstack
読み込んだプラグイン:fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=storage-ceph-nautilus error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 不明なエラー"
One of the configured repositories failed (不明),
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=<repoid> ...
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 <repoid>
or
subscription-manager repos --disable=<repoid>
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=<repoid>.skip_if_unavailable=true
Cannot find a valid baseurl for repo: centos-ceph-nautilus/7/x86_64
このあと別のyumコマンドを実行するが、不明のエラーが表示される
yum repolist
読み込んだプラグイン:fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=storage-ceph-nautilus error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 不明なエラー"
Loading mirror speeds from cached hostfile
Loading mirror speeds from cached hostfile
Loading mirror speeds from cached hostfile
Loading mirror speeds from cached hostfile
Loading mirror speeds from cached hostfile
Loading mirror speeds from cached hostfile
Loading mirror speeds from cached hostfile
リポジトリー ID リポジトリー名 状態
base/x86_64 CentOS-7 - Base 0
centos-ceph-nautilus/7/x86_64 CentOS-7 - Ceph Nautilus 0
centos-nfs-ganesha28/7/x86_64 CentOS-7 - NFS Ganesha 2.8 0
centos-openstack-stein/7/x86_64 CentOS-7 - OpenStack stein 0
centos-qemu-ev/7/x86_64 CentOS-7 - QEMU EV 0
extras/x86_64 CentOS-7 - Extras 0
updates/x86_64 CentOS-7 - Updates 0
repolist: 0
なお最初に「yum repolist」コマンドを実行すればエラーにはならない
[root@localhost ~]# yum repolist
読み込んだプラグイン:fastestmirror
Determining fastest mirrors
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/4): base/x86_64/group_gz | 153 kB 00:00:00
(2/4): extras/x86_64/primary_db | 253 kB 00:00:00
(3/4): base/x86_64/primary_db | 6.1 MB 00:00:00
(4/4): updates/x86_64/primary_db | 27 MB 00:00:00
リポジトリー ID リポジトリー名 状態
base/x86_64 CentOS-7 - Base 10,072
extras/x86_64 CentOS-7 - Extras 526
updates/x86_64 CentOS-7 - Updates 6,173
repolist: 16,771
参考サイトを元に対処した記録
【インターネットにつながるか確認】
ping -c 4 8.8.8.8
【現在の利用OSを確認し、リポジトリサイトのURLを選択する】
cat /etc/redhat-release
実行結果
CentOS Linux release 7.9.2009 (Core)
http://ftp.jaist.ac.jp/pub/Linux/CentOS/(参考サイトが利用していたミラーサイトと同じものを利用)
今回利用するミラーサイトのURL
http://ftp.jaist.ac.jp/pub/Linux/CentOS-vault/7.9.2009/
【ファイルの編集】
base、updates、extrasセクションにおいて、mirrorlist行をコメントアウトする
baseurlを先ほど調べたURLに書き換える
※centosplusセクションに関しては何もいじっていない
vi /etc/yum.repos.d/CentOS-Base.repo
baseセクションの書き換え
末尾に「/os/$basearch/」を追加
baseurl=http://ftp.jaist.ac.jp/pub/Linux/CentOS-vault/7.9.2009/os/$basearch/
updateセクションの書き換え
末尾に「/updates/$basearch/」を追加
baseurl=http://ftp.jaist.ac.jp/pub/Linux/CentOS-vault/7.9.2009/updates/$basearch/
extrasセクションの書き換え
baseurl=http://ftp.jaist.ac.jp/pub/Linux/CentOS-vault/7.9.2009/extras/$basearch/
【編集後のファイル全体】
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&in
fra=$infra
baseurl=http://ftp.jaist.ac.jp/pub/Linux/CentOS-vault/7.9.2009/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
baseurl=http://ftp.jaist.ac.jp/pub/Linux/CentOS-vault/7.9.2009/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
baseurl=http://ftp.jaist.ac.jp/pub/Linux/CentOS-vault/7.9.2009/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
baseurl=http://ftp.jaist.ac.jp/pub/Linux/CentOS-vault/7.9.2009/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
【エラー】
centosplus箇所を変更後再度、yumでエラー
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=storage-ceph-nautilus error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 不明なエラー"
mirrolist行をコメントアウトしているが、念のため削除してみる
やはりエラー
「http://mirrorlist.centos.org」をどこから参照しているのかわからんんんn
[root@localhost ~]# yum install -y openstack-packstack
読み込んだプラグイン:fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=storage-ceph-nautilus error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 不明なエラー"
One of the configured repositories failed (不明),
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=<repoid> ...
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 <repoid>
or
subscription-manager repos --disable=<repoid>
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=<repoid>.skip_if_unavailable=true
Cannot find a valid baseurl for repo: centos-ceph-nautilus/7/x86_64
CentOSインストール後に行ったこと(エラーと関係ないとは思いますが…念のため)
【IPアドレスの固定】
vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
ファイルを書き換える部分
ONBOOT = yes
BOOTPROTO = none
ファイルに追記する部分
IPADDR = 192.168.1.200
NETMASK = 255.255.255.0
GATEWAY = 192.168.1.1
DNS1 = 8.8.8.8
systemctl restart network.service
【いろいろ無効化する】
systemctl disable firewalld
systemctl stop firewalld
systemctl disable NetworkManager
systemctl stop NetworkManager
systemctl enable network
systemctl start network
SELinux無効化
vi /etc/sysconfig/selinux
SELINUX=disabled ←書き換える
shutdown -r now
コメント