分别配置两台real-server:
[root@martin ~]# ip addr add 192.168.1.199/32 label lo:0 brd 192.168.1.199 dev lo
[root@martin ~]# echo 1 > /proc/sys/net/ipv4/conf/eth0/arp_ignore
[root@martin ~]# echo 2 > /proc/sys/net/ipv4/conf/eth0/arp_announce
[root@martin ~]# echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore
[root@martin ~]# echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce
实验结果
[root@marvin keepalived]# ipvsadm -L -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 192.168.1.199:80 rr
-> 192.168.1.222:80 Route 1 0 0
-> 192.168.1.223:80 Route 1 0 0
[root@sherry keepalived]# ipvsadm -L -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 192.168.1.199:80 rr
-> 192.168.1.222:80 Route 1 0 0
-> 192.168.1.223:80 Route 1 0 0
Linux下HAProxy+Keepalived双机高可用方案
Haproxy+Keepalived搭建Weblogic高可用负载均衡集群
CentOS 6.3下Haproxy+Keepalived+Apache配置笔记