1.检查内核版本
[root@localhost SPECS]# uname -a Linux localhost 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
3.执行rpm -ivh ipvsadm-1.24-6.src.rpm
4.执行cd /usr/src/redhat/SPEC
5.执行rmpbuild -ba --target=i686 ipvsadm.spec时,会unknown tag:Copyright...这样的错误
6.通过vi ipvsadm.spec,,将第7行Copyright修改为License
7..创建Symbol Link:
ln -s /usr/src/kernels/2.6.18-194.el5-x86_64/ /usr/src/linux (64位机器)
ln -s /usr/src/kernels/2.6.18-92.e15-i686 /usr/src/linux
8.执行rmpbuild -ba --target=i686 ipvsadm.spec
9.执行rpm -ivh /usr/src/redhat/RPMS/i686/ipvsadm-1.24-6.i686.rpm
10.输入ipvsadm,如果显示如下类似信息,则证明ipvsadm已安装成功:
[root@localhost SPECS]# ipvsadm IP Virtual Server version 1.2.1 (size=4096) Prot LocalAddress:Port Scheduler Flags -> RemoteAddress:Port Forward Weight ActiveConn InActConn
# find / -name ipvsadm /usr/src/redhat/BUILD/ipvsadm-1.24/ipvsadm /sbin/ipvsadm /etc/rc.d/init.d/ipvsadm /var/lock/subsys/ipvsadm
/etc/init.d/ipvsadm start会报错
[root@localhost ~]# /etc/init.d/ipvsadm start
Clearing the current IPVS table: [确定]
Applying IPVS configuration: /etc/init.d/ipvsadm: line 62: /etc/sysconfig/ipvsadm: 没有那个文件或目录
注:遇到这个错误。运行service ipvsadm save。之后再执行service ipvsadm start