最近正在研究nfs+heartbeat+drbd简历高可用nfs服务器,其中我yum安装heartbeat的时候提示我yum安装错误,后来改为本地yum作为源。但是redhat5.4光盘镜像没有自带heartbeat于是想借用centos的网络yum源。
查看本地是否安装yum包
rpm -qa | grep yum
如果已经安装卸载
rpm -qa | grep yum | xargs rpm -e --nodeps
下载一下安装包
wget -b http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-3.2.22-39.el5.centos.noarch.rpm
wget -b http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
wget -b http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-updatesd-0.9-2.el5.noarch.rpm
wget -b http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
安装 rpm -ivh yum-*
3.cd /etc/yum.repos.d/
wget -b http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
4. 导入KEY文件,注意大小写
rpm --import http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
5.测试 yum
[root@node1 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Cluster | 1.3 kB 00:00
Cluster/filelists | 110 kB 00:00
Cluster/other | 30 kB 00:00
ClusterStorage | 1.3 kB 00:00
ClusterStorage/filelists | 11 kB 00:00
ClusterStorage/other | 12 kB 00:00
Server | 1.3 kB 00:00
Server/filelists | 2.3 MB 00:00
Server/other | 6.3 MB 00:00
VT | 1.3 kB 00:00
VT/filelists | 26 kB 00:00
VT/other | 38 kB 00:00
addons | 1.9 kB 00:00
addons/filelists_db | 564 B 00:00
addons/other_db | 552 B 00:00
addons/primary_db | 1.1 kB 00:00
base | 1.1 kB 00:00
base/filelists | 3.0 MB 00:27
base/other | 10 MB 01:04
base/group | 1.1 MB 00:06
base/primary | 967 kB 00:02
extras | 2.1 kB 00:00
extras/filelists_db | 217 kB 00:00
extras/other_db | 448 kB 00:01
extras/group | 9.7 kB 00:00
extras/primary_db | 174 kB 00:00
update | 1.9 kB 00:00
update/filelists_db | 4.3 MB 00:15
update/other_db | 22 MB 01:24
update/primary_db | 936 kB 00:18
base 2725/2725
Cluster 32/32
ClusterStorage 39/39
Server 2292/2292
VT 36/36
base 2725/2725
Cluster 32/32
ClusterStorage 39/39
Server 2292/2292
VT 36/36
base 2725/2725
Metadata Cache Created
本文参考了文章http://toptree.iteye.com/blog/1173725