KVS Keepalived DR环境配置方法(一)
1、web3和web4都要操作准备RS的web服务,web3/web4安装httpdyum install httpd -y

3、访问测试[root@web4 ~]# curl 192.168.122.53welcome to web3You have new mail in /var/spool/mail/root[root@web4 ~]# curl 192.168.122.54welcome to web4[root@web4 ~]#

5、RS配置VIP接口,web3/web4 同时配置[root@web3 卯掏跨几~]# ifconfig lo:0 192.168.122.200 netmask 255.255.255.255 broadcast 192.168.122.200 upYou have new mail in /var/spool/mail/root[root@web3 ~]# route add -host 192.168.122.200 dev lo:0[root@web3 ~]# route -nKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface192.168.122.200 0.0.0.0 255.255.255.255 UH 0 0 0 lo192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth00.0.0.0 192.168.122.1 0.0.0.0 UG 0 0 0 eth0

7、web1/web2上操作[root@web1 ~]# ipvsadm -C[root@web1 ~]# ipvsadm -A -t 192.168.122.200:80 -s rr[root@web1 ~]# ipvsadm -a -t 192.168.122.200:80 -r 192.168.122.53 -g -w 1[root@web1 ~]# ipvsadm -a -t 192.168.122.200:80 -r 192.168.122.54 -g -w 2[root@web1 ~]# ipvsadm -L -nIP Virtual Server version 1.2.1 (size=4096)Prot LocalAddress:Port Scheduler Flags -> RemoteAddress:Port Forward Weight ActiveConn InActConnTCP 192.168.122.200:80 rr -> 192.168.122.53:80 Route 1 0 0 -> 192.168.122.54:80 Route 2 0 0 [root@web1 ~]#
