启动命令:
service keepalived start | stop
service lvsrs start | stop
查看DS上的keepalived是否配置成功:
tail -f /var/log/message
[iyunv@localhost ~]# tail -f /var/log/messages
Feb 2 16:22:04 localhost Keepalived_healthcheckers[2498]: Activating healthchecker for service [192.168.137.100]:80
Feb 2 16:22:04 localhost Keepalived_healthcheckers[2498]: Activating healthchecker for service [192.168.137.200]:80
Feb 2 16:22:04 localhost Keepalived_vrrp[2499]: VRRP_Instance(VI_1) Transition to MASTER STATE
Feb 2 16:22:04 localhost Keepalived_vrrp[2499]: VRRP_Instance(VI_1) Received lower prio advert, forcing new election
Feb 2 16:22:05 localhost Keepalived_healthcheckers[2498]: TCP connection to [192.168.137.200]:80 failed !!!
Feb 2 16:22:05 localhost Keepalived_healthcheckers[2498]: Removing service [192.168.137.200]:80 from VS [192.168.137.6]:80
Feb 2 16:22:05 localhost Keepalived_vrrp[2499]: VRRP_Instance(VI_1) Entering MASTER STATE
Feb 2 16:22:05 localhost Keepalived_vrrp[2499]: VRRP_Instance(VI_1) setting protocol VIPs.
Feb 2 16:22:05 localhost Keepalived_vrrp[2499]: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth0 for 192.168.137.6
Feb 2 16:22:05 localhost Keepalived_healthcheckers[2498]: Netlink reflector reports IP 192.168.137.6 added
Feb 2 16:22:10 localhost Keepalived_vrrp[2499]: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth0 for 192.168.137.6
查看分发配置: