急求解!! LVS/DR轮询失效,每次都去访问同一台

配置:
三台虚拟机,分别是192.168.137.110/111/113,这三台都能进行互相ping通,且和主机使用host-only模式进行搭设,且之间能ping通
loadbrand: 113这一台
#ifconfig eth1:1 192.168.137.159 broadcast 192.168.137.159 netmask 255.255.255.255 up
#route add -host 192.168.137.159 dev eth1:1
#echo 1 > /proc/sys/net/ipv4/ip_forward --开启IP转发功能

#ipvsadm -C
#ipvsadm -A -t 192.168.137.159:8080 -s rr -p 600
#ipvsadm -a -t 192.168.137.159:8080 -r 192.168.137.110 -g -w 1
#ipvsadm -a -t 192.168.137.159:8080 -r 192.168.137.111 -g -w 1

(2).在realserve1服务器上进行配置:110
# echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignore
# echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore
# echo 2 > /proc/sys/net/ipv4/conf/lo/arp_announce
# echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce

#ifconfig lo:0 192.168.137.159 broadcast 192.168.137.159 netmask 255.255.255.255 up
#route add -host 192.168.137.159 dev lo:0
(3).在realserver2 服务器上进行配置
# echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignore
# echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore
# echo 2 > /proc/sys/net/ipv4/conf/lo/arp_announce
# echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce

#ifconfig lo:0 192.168.137.159 broadcast 192.168.137.159 netmask 255.255.255.255 up
#route add -host 192.168.137.159 dev lo:0

之后进行测试,http://192.168.137.159:9090/发现每次只能去访问192.168.137.111这台。不能进行轮询,是配置出错还是?求解????

Forums:

persistence_timeout 选项注释了没有,意思就是在这个一定时间内会讲来自同一用户(根据ip来判断的)route到同一个real
server。

ipvsadm -A -t 192.168.137.159:8080 -s rr -p 600
-p 制定了 600秒时间内,同一来源转发到上次转发的机器中