virtual_ipaddress {
10.50.85.200 dev br0 label br0:0
}
}
3 master 交换机中该网口down掉
3.1 85.26(master)
Nov 24 14:50:58 host85-26 kernel: igb 0000:01:00.0: eth0: igb: eth0 NIC Link is Down
Nov 24 14:50:58 host85-26 kernel: bonding: bond0: link status definitely down for interface eth0, disabling it
Nov 24 14:50:58 host85-26 kernel: bonding: bond0: making interface eth1 the new active one.
Nov 24 14:50:58 host85-26 kernel: device eth0 left promiscuous mode
Nov 24 14:50:58 host85-26 kernel: device eth1 entered promiscuous mode
Nov 24 14:51:06 host85-26 kernel: igb 0000:01:00.1: eth1: igb: eth1 NIC Link is Down
Nov 24 14:51:06 host85-26 kernel: bonding: bond0: link status definitely down for interface eth1, disabling it
Nov 24 14:51:06 host85-26 kernel: device eth1 left promiscuous mode
Nov 24 14:51:06 host85-26 kernel: bonding: bond0: now running without any active interface !
Nov 24 14:51:07 host85-26 kernel: br0: port 1(bond0) entering disabled state
总结:master的br0中绑定的两个实际的网卡都down了,但是vip并没有移除
3.2 85.56(slave)
Nov 24 14:51:09 host85-56 Keepalived_vrrp[193405]: VRRP_Instance(VI_2) Transition to MASTER STATE
Nov 24 14:51:10 host85-56 Keepalived_vrrp[193405]: VRRP_Instance(VI_2) Entering MASTER STATE
Nov 24 14:51:10 host85-56 Keepalived_vrrp[193405]: VRRP_Instance(VI_2) setting protocol VIPs.
Nov 24 14:51:10 host85-56 Keepalived_vrrp[193405]: VRRP_Instance(VI_2) Sending gratuitous ARPs on br0 for 10.50.85.200
Nov 24 14:51:10 host85-56 Keepalived_healthcheckers[193403]: Netlink reflector reports IP 10.50.85.200 added
总结:master down了之后,slave变成master,设置了vip,对外提供服务
4 master交换机中该网口up
4.1 85.26(master)
Nov 24 14:52:06 host85-26 Keepalived_vrrp[76194]: VRRP_Instance(VI_1) Received lower prio advert, forcing new election
Nov 24 14:52:06 host85-26 Keepalived_vrrp[76194]: VRRP_Instance(VI_1) Sending gratuitous ARPs on br0 for 10.50.85.200
Nov 24 14:52:11 host85-26 kernel: igb 0000:01:00.0: eth0: igb: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
Nov 24 14:52:11 host85-26 kernel: bond0: link status definitely up for interface eth0, 1000 Mbps full duplex.
Nov 24 14:52:21 host85-26 kernel: br0: port 1(bond0) entering forwarding state
总结:master网络up之后,自动变为主了,日志中没有体现,因为此优先级高
4.2 85.56(slave)
Nov 24 14:52:06 host85-56 Keepalived_vrrp[193405]: VRRP_Instance(VI_2) Received higher prio advert
Nov 24 14:52:06 host85-56 Keepalived_vrrp[193405]: VRRP_Instance(VI_2) Entering BACKUP STATE
Nov 24 14:52:06 host85-56 Keepalived_vrrp[193405]: VRRP_Instance(VI_2) removing protocol VIPs.
Nov 24 14:52:06 host85-56 Keepalived_healthcheckers[193403]: Netlink reflector reports IP 10.50.85.200 removed
总结:slave收到mater消息后,将自己的vip移除