脚步
192.168.10.100 ) 在步骤6之后,Ping不起作用。没有服务器获得虚拟IP。 (我查了ip addr show eth1 )
Master可以取回虚拟ip,直到我重新启动keepalived服务。
如何让主人获得虚拟IP而不重新启动服务?
Keepalivedconfiguration:
主机1(主)
vrrp_instance VI_1 { state MASTER interface eth1 virtual_router_id 51 priority 101 advert_int 1 authentication { auth_type PASS auth_pass secret } virtual_ipaddress { 192.168.10.100 } }
主机2(从机)
vrrp_instance VI_1 { state BACKUP interface eth1 virtual_router_id 51 priority 100 advert_int 1 authentication { auth_type PASS auth_pass secret } virtual_ipaddress { 192.168.10.100 } }
只有跳出你的configuration和我正在使用的是不同的
virtual_ipaddress { <ip> dev <devname> }
这可能不是严格必要的,但这是唯一的区别,我可以看到与已知的工作设置。
解释你可以在这里find: https : //github.com/acassen/keepalived/blob/317555e304372205cf634f252e72c5b6de0eb1b6/doc/man/man5/keepalived.conf.5
对于selectMASTER,最高优先级的胜利。 成为MASTER,使这50以上比其他机器。
MASTER和BACKUP优先级101-100 = 1之间的差异。 它必须至less为50.将MASTER优先级从101更改为100,将BACKUP优先级从100更改为50。