Keepalived VIP在两台服务器上都处于活动状态

我已经在两台RHEL 7服务器上configuration了keepalived,如下所示

主服务器

vrrp_instance VI_1 { state MASTER interface eth0 virtual_router_id 51 priority 100 advert_int 1 authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 10.1.1.181 } } 

辅助服务器

 vrrp_instance VI_1 { state BACKUP interface eth0 virtual_router_id 51 priority 99 advert_int 1 authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 10.1.1.181 } } 

重新启动keepalived服务并执行ip addr show eth0后,两台服务器上的VIP都处于活动状态。 我能够从主要从中学和中学ping主要。

好心提醒。

在什么样的环境下运行这个keepalived实例? 我在不支持多播的环境中看到类似的问题。 Keepalived在默认情况下使用多播VRRP通告。 所以,请尝试使用单播。 这是MASTER实例的示例,对于BACKUP实例,只需replaceunicast_src_ipunicast_peer地址即可。

 vrrp_instance VI_1 { state MASTER interface eth0 virtual_router_id 51 priority 100 advert_int 1 authentication { auth_type PASS auth_pass 1111 } unicast_src_ip 10.0.0.2 # IP address of local interface unicast_peer { # IP address of peer interface 10.0.0.3 } virtual_ipaddress { 10.1.1.181 } }