我的keepalivedconfiguration不能正常工作。
我有两个虚拟testing机器(virtualbox)用keepalived / vrrp来尝试一些东西。 Bot可以完美地相互ping通(内部virtualboxnetworking)。
VM 1(MASTER):
eth0: Management eth1: 192.168.2.1/24 eth2: 192.168.2.2/24 keepalived.conf: vrrp_instance test { state MASTER interface eth1 track_interface { eth2 } virtual_router_id 1 priority 101 advert_int 1 authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 192.168.3.1/24 dev eth1 192.168.3.2/24 dev eth2 } } tcpdump on eth1: 12:44:54.720119 IP 192.168.2.1 > vrrp.mcast.net: VRRPv2, Advertisement, vrid 1, prio 101, authtype simple, intvl 1s, length 24 12:44:55.049465 IP 192.168.2.3 > vrrp.mcast.net: VRRPv2, Advertisement, vrid 1, prio 100, authtype simple, intvl 1s, length 24 tcpdump on eth2: 12:46:21.082264 IP 192.168.2.1 > vrrp.mcast.net: VRRPv2, Advertisement, vrid 1, prio 101, authtype simple, intvl 1s, length 24 12:46:21.494239 IP 192.168.2.3 > vrrp.mcast.net: VRRPv2, Advertisement, vrid 1, prio 100, authtype simple, intvl 1s, length 24
VM 2(备份):
eth0: Management eth1: 192.168.2.3/24 eth2: 192.168.2.4/24 keepalived.conf: vrrp_instance test { state BACKUP interface eth1 track_interface { eth2 } virtual_router_id 1 priority 100 advert_int 1 authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 192.168.3.1/24 dev eth1 192.168.3.2/24 dev eth2 } } tcpdump on eth1: 12:53:12.265456 IP 192.168.2.1 > vrrp.mcast.net: VRRPv2, Advertisement, vrid 1, prio 101, authtype simple, intvl 1s, length 24 12:53:12.670635 IP 192.168.2.3 > vrrp.mcast.net: VRRPv2, Advertisement, vrid 1, prio 100, authtype simple, intvl 1s, length 24 tcpdump on eth2: 12:53:34.397374 IP 192.168.2.1 > vrrp.mcast.net: VRRPv2, Advertisement, vrid 1, prio 101, authtype simple, intvl 1s, length 24 12:53:34.787327 IP 192.168.2.3 > vrrp.mcast.net: VRRPv2, Advertisement, vrid 1, prio 100, authtype simple, intvl 1s, length 24
在VM 2上启动keepalived后,它立即转移到主状态,不应该是。
为什么发生这种情况?