安装Keepalived,启动后发现VIP不在,通过查看服务状态没,发现以下报错:
Oct 14 18:22:32 master1 Keepalived_vrrp[1244]: VRRP_Instance(VI_1) ignoring received advertisment...
Oct 14 18:22:33 master1 Keepalived_vrrp[1244]: (VI_1): ip address associated with VRID 80 not present in MASTER advert : 192.168.1.8
Oct 14 18:22:33 master1 Keepalived_vrrp[1244]: bogus VRRP packet received on ens192 !!!
Oct 14 18:22:33 master1 Keepalived_vrrp[1244]: VRRP_Instance(VI_1) ignoring received advertisment...
Oct 14 18:22:34 master1 Keepalived_vrrp[1244]: (VI_1): ip address associated with VRID 80 not present in MASTER advert : 192.168.1.8
Oct 14 18:22:34 master1 Keepalived_vrrp[1244]: bogus VRRP packet received on ens192 !!!
Oct 14 18:22:34 master1 Keepalived_vrrp[1244]: VRRP_Instance(VI_1) ignoring received advertisment...
Oct 14 18:22:35 master1 Keepalived_vrrp[1244]: (VI_1): ip address associated with VRID 80 not present in MASTER advert : 192.168.1.8
Oct 14 18:22:35 master1 Keepalived_vrrp[1244]: bogus VRRP packet received on ens192 !!!
Oct 14 18:22:35 master1 Keepalived_vrrp[1244]: VRRP_Instance(VI_1) ignoring received advertisment...
报错原因: 查阅资料折腾了一番后,可能是keepalive master的virtual_router_id和局域网内的其它的keepalive master的virtual_router_id有冲突
解决办法: 修改 /etc/keepalived/keepalived.conf 配置文件里的 virtual_router_id 51 为其它数值后,启动keepalive后日志不再报错。
需要注意的是: 从节点的keepalive的virtual_router_id是需要和主节点的virtual_router_id 保持一致的,不然的话,两个keepalive节点貌似都是以master的身份工作,不过测试了下,这样两个主的keeplive貌似也是能起到 虚拟ip 高可用的作用,只不过两个keeplive单独起作用而已,虚拟ip会路由带后启动的keeplive 的节点上。