rpm -ql ipvsadm
rpm -y install ipvsadm
ifconfig eth0:1 192.168.2.150/24
实验环境是两台RealServer 静态IP分别为: 192.168.2.137 192.168.2.138
echo "1" >/proc/sys/net/ipv4/conf/eth0/arp_ignore echo "1" >/proc/sys/net/ipv4/conf/all/arp_ignore echo "2" >/proc/sys/net/ipv4/conf/all/arp_announce echo "2" >/proc/sys/net/ipv4/conf/eth0/arp_announce
ifconfig lo:1 192.168.2.150 netmask 255.255.255.255 broadcast 192.168.2.150
route add -host 192.168.2.150 dev eth0:1
route add -host 192.168.2.150 dev lo:1
yum -y install httpd #启动httpd service httpd start/stop/restart
192.168.2.137 192.168.2.138
#创建集群服务 ipvsadm -C ipvsadm -A -t 192.168.2.150:80 -s wlc ipvsadm -a -t 192.168.2.150:80 -r 192.168.2.138 -g -w 1 ipvsadm -a -t 192.168.2.150:80 -r 192.168.2.137 -g -w 1 #查看 ipvsadm -Ln ipvsadm -L
本文出自 “素颜” 博客,请务必保留此出处http://suyanzhu.blog.51cto.com/8050189/1945029
原文地址:http://suyanzhu.blog.51cto.com/8050189/1945029