keepalived启动后报received an invalid passwd!
一、配置好keepalived.conf文件后,启动keepalived,查看/var/log/message日志报错:
[root@localhost ]# tail /var/log/messages Mar 14 10:17:20 node3_1_3 Keepalived_vrrp[143988]: (VI_1): received an invalid passwd! Mar 14 10:17:20 node3_1_3 Keepalived_vrrp[143988]: bogus VRRP packet received on br0 !!! Mar 14 10:17:20 node3_1_3 Keepalived_vrrp[143988]: VRRP_Instance(VI_1) ignoring received advertisment... Mar 14 10:17:21 node3_1_3 Keepalived_vrrp[143988]: (VI_1): received an invalid passwd! Mar 14 10:17:21 node3_1_3 Keepalived_vrrp[143988]: bogus VRRP packet received on br0 !!! Mar 14 10:17:21 node3_1_3 Keepalived_vrrp[143988]: VRRP_Instance(VI_1) ignoring received advertisment... Mar 14 10:17:22 node3_1_3 Keepalived_vrrp[143988]: (VI_1): received an invalid passwd! Mar 14 10:17:22 node3_1_3 Keepalived_vrrp[143988]: bogus VRRP packet received on br0 !!! Mar 14 10:17:22 node3_1_3 Keepalived_vrrp[143988]: VRRP_Instance(VI_1) ignoring received advertisment...
二、原因分析
因为virtual_router_id,路由ID实例,必须是唯一的,其它环境中有存在相同的实例ID,所以要修改一个其它的实例ID
(base) [root@zgg_node3_1_3 keepalived]# cat keepalived.conf # Please do not change this file directly since it is managed by Ansible and will be overwritten ! Configuration File for keepalived global_defs { router_id mysql1 } vrrp_script check_mysql { script "/etc/keepalived/check_mysql.sh" weight -20 interval 5 rise 2 fall 2 } vrrp_instance VI_1 { state MASTER priority 100 interface br0 virtual_router_id 86 ##之前是51,应该是被其他的环境占用了,后来改成86就可以了(保证不冲突) advert_int 1 authentication { auth_type PASS auth_pass dnf1 } virtual_ipaddress { 172.16.1.131/16 } track_script { check_mysql } }
主备都修改成新的virtual_router_id,都重启keepalived,重启后再测试已正常。
[root@lb-master ~]# systemctl restart keepalived
[root@lb-backup ~]# systemctl restart keepalived