备用节点的配置与主节点基本相同,只需要修改如下部分:
# vrrp实例定义部分
state BACKUP # 在备用节点上,此处修改为BACKUP
priority 90 # 优先级的设置也不能高于主节点
4、启动并测试
[root@localhost ~]# service keepalived start
[root@localhost ~]# ipvsadm -L
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 192.168.56.200:http wlc
-> 192.168.56.103:http Route 1 0 0
-> 192.168.56.104:http Route 1 0 0
可以通过ipvsadm命令看到已经检测到客户端