安裝openstack最後到dashboard的時候報錯:[Errno 256] No more mirrors to try.
很簡單:
1.yum clean metadata
2.yum clean all
搞定!
至此,openstack也差不多一個個組件都正常了。接下來準備跑個vyos(電腦是真的有點hold不住)。
後面寫個品質高一點的文章“How vRouter live in a cloud?”
YUM安裝遭遇: [Errno 256] No more mirrors to try
把YUM配置好後,使用yum命令進行安裝時,出現了如下錯誤:
Downloading Packages:
ftp://192.168.220.46/RHEL6.2/x64/Server/libaio-devel-0.3.107-10.el6.x86_64.rpm: [Errno 14] PYCURL ERROR 19 - "Given file does not exist"
Trying other mirror.
Error Downloading Packages:
libaio-devel-0.3.107-10.el6.x86_64: failure: libaio-devel-0.3.107-10.el6.x86_64.rpm from RHEL6.2-Server-X64: [Errno 256] No more mirrors to try.
最開始以為是用戶端的yum源配置緩衝的問題,使用yum clean all命令清除後還是出現同樣的錯誤。
最後竟然發現我的RHEL6.2作業系統原理沒有預設安裝ftp工具,坑爹啊!沒辦法只能從光碟片再安裝一下ftp工具:
[root@instsvr1 Packages]# rpm -ivh ftp-0.17-51.1.el6.x86_64.rpm
warning: ftp-0.17-51.1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ########################################### [100%]
1:ftp ########################################### [100%]
順便把telnet工具和服務也給裝上了:
[root@instsvr1 Packages]# rpm -ivh telnet-*
warning: telnet-0.17-47.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ########################################### [100%]
1:telnet-server ########################################### [ 50%]
2:telnet ########################################### [100%]
安裝了工具後結果還是報錯,整了半天,才發現原來"Given file does not exist"資訊是正確的,目錄RHEL6.2/x64/Server下的確是沒有libaio-devel-0.3.107-10.el6.x86_64.rpm這個檔案,原來 在建立repodata時指定的是RPM包目錄是RHEL6.2/x64/Packages,而yum工具會直接從RHEL6.2/x64/Server/目錄下去尋找安裝包,所以在RHEL6.2/x64/Server/目錄下把Packages包下相應的檔案link過來就可以了。
太粗心了!!!!!!!!
配置RHEL6.2的YUM源
伺服器端:
1、 由於yum安裝支援三種協議:file://、ftp://和http://,因此如果是使用本地檔案作為源,則可直接使用file:\\協議,否則需要先準備好ftp或者http服務。這次測試的是ftp源,因此需要配置好ftp服務,並且要把ftp服務配置為可匿名登入,並且要把rpm包都放在ftp匿名登入的root目錄下面。Vsftp匿名登入的配置為:
anonymous_enable=YES
anon_root=/share(這個為vsftp匿名登入的root目錄,並且其屬性不能為/etc/vsftp/ftpusers,/etc/vsftp/user_list檔案中所配置的使用者,否則不能匿名登入)
如果不配置匿名登入或者匿名登入root目錄設定不對會出現如下錯誤:
[root@srcbdc yum.repos.d]# yum list
Loaded plugins: aliases, rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
ftp://yumserver/RHEL/Server/repodata/repomd.xml: [Errno 4] IOError: [Errno ftp error] 550 Failed to change directory.
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: RHEL-Server. Please verify its path and try again
2、 先檢查yum是否已安裝,如果沒有安裝可以從光碟片裡面安裝
[root@srcbdc ~]# rpm -qa|grep yum
yum-security-1.1.16-13.el5
yum-rhn-plugin-0.5.4-13.el5
yum-metadata-parser-1.1.2-3.el5
yum-updatesd-0.9-2.el5
yum-aliases-1.1.16-13.el5
yum-3.2.22-20.el5
3、 安裝另一個用於yum的包createrepo
[root@srcbdc Server]# rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm
warning: createrepo-0.4.11-3.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:createrepo ########################################### [100%]
這個工具主要是用來生產yum所需要用到的安裝包關係的資料庫。
4、 把系統硬碟中的Server目錄和VT目錄拷貝到新的目錄裡面,我的是從ISO檔案裡面複製出來的
先掛載ISO檔案
[root@srcbdc ~]# mount -o loop /instsvr/ISO/rhel-server-6.2-x86_64-dvd.iso /mnt
Copy檔案
[root@srcbdc ~]# mkdir -p /instsvr/RHEL6.2/x64
[root@srcbdc ~]# cp -r /mnt/ /instsvr/RHEL6.2/x64
5、 建立rpm關聯式資料庫
[root@srcbdc ~]# createrepo -g /instsvr/RHEL6.2/x64/Server/repodata/*comps-rhel6-Server.xml -o /instsvr/RHEL6.2/x64/Server -i /instsvr/RHEL6.2/x64/Server/listing /instsvr/RHEL6.2/x64/Packages/
[root@srcbdc ~]# createrepo -g /instsvr/RHEL6.2/x64/HighAvailability/repodata/*comps-rhel6-HighAvailability.xml -o /instsvr/RHEL6.2/x64/HighAvailability -i /instsvr/RHEL6.2/x64/HighAvailability/listing /instsvr/RHEL6.2/x64/Packages/
[root@srcbdc ~]# createrepo -g /instsvr/RHEL6.2/x64/LoadBalancer/repodata/*comps-rhel6-LoadBalancer.xml -o /instsvr/RHEL6.2/x64/LoadBalancer -i /instsvr/RHEL6.2/x64/LoadBalancer/listing /instsvr/RHEL6.2/x64/Packages/
[root@srcbdc ~]# createrepo -g /instsvr/RHEL6.2/x64/ResilientStorage/repodata/*comps-rhel6-ResilientStorage.xml -o /instsvr/RHEL6.2/x64/ResilientStorage -i /instsvr/RHEL6.2/x64/ResilientStorage/listing /instsvr/RHEL6.2/x64/Packages/
[root@srcbdc ~]# createrepo -g /instsvr/RHEL6.2/x64/ScalableFileSystem/repodata/*comps-rhel6-ScalableFileSystem.xml -o /instsvr/RHEL6.2/x64/ScalableFileSystem -i /instsvr/RHEL6.2/x64/ScalableFileSystem/listing /instsvr/RHEL6.2/x64/Packages/
建立rpm包的link檔案:
[root@srcbdc ~]# cd /instsvr/RHEL6.2/x64/Server
[root@srcbdc ScalableFileSystem]# for i in `cat listing`; do ln -s ../Packages/$i $i; done
[root@srcbdc ~]# cd /instsvr/RHEL6.2/x64/HighAvailability
[root@srcbdc ScalableFileSystem]# for i in `cat listing`; do ln -s ../Packages/$i $i; done
[root@srcbdc ~]# cd /instsvr/RHEL6.2/x64/LoadBalancer
[root@srcbdc ScalableFileSystem]# for i in `cat listing`; do ln -s ../Packages/$i $i; done
[root@srcbdc ~]# cd /instsvr/RHEL6.2/x64/ResilientStorage
[root@srcbdc ScalableFileSystem]# for i in `cat listing`; do ln -s ../Packages/$i $i; done
[root@srcbdc ~]# cd /instsvr/RHEL6.2/x64/ScalableFileSystem
[root@srcbdc ScalableFileSystem]# for i in `cat listing`; do ln -s ../Packages/$i $i; done
6、 清除yum緩衝資訊
[root@srcbdc yum.repos.d]# yum clean all
Loaded plugins: aliases, rhnplugin, security
Cleaning up Everything
7、 再使用yum list名稱查看rpm包,正常的話會列出所有的rpm包
用戶端:
用戶端就比較好配置了,只需要在/etc/yum.d.repo/目錄小添加本地yum源設定檔即可
[root@instsvr1 yum.repos.d]# cat rhel6.2-x64.repo
[RHEL6.2-Server-X64]
name=Red Hat Enterprise Linux Install Server
baseurl=ftp://192.168.220.46/RHEL6.2/x64/Server
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-RedHat-release
[RHEL6.2-HighAvailability-X64]
name=Red Hat Enterprise Linux Install Server
baseurl=ftp://192.168.220.46/RHEL6.2/x64/HighAvailability/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[RHEL6.2-LoadBalancer-X64]
name=Red Hat Enterprise Linux Install Server
baseurl=ftp://192.168.220.46/RHEL6.2/x64/LoadBalancer/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[RHEL6.2-ResilientStorage-X64]
name=Red Hat Enterprise Linux Install Server
baseurl=ftp://192.168.220.46/RHEL6.2/x64/ResilientStorage/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[RHEL6.2-ScalableFileSystem-X64]
name=Red Hat Enterprise Linux Install Server
baseurl=ftp://192.168.220.46/RHEL6.2/x64/ScalableFileSystem/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[RHEL-RPMS]
name=Red Hat Enterprise Linux Install Server
baseurl=ftp://192.168.220.46/rpms
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release