How to see keepalived priority number when it changed

keepalived

I have used keepalived to archive high availability for nginx. I set initial priority 101 for MASTER, 100 for BACKUP and I can see /var/log/messages :

Keepalived_vrrp[34483]: VRRP_Script(chk_nginx) failed
Keepalived_vrrp[34483]: VRRP_Instance(VI_1) Received higher prio advert
Keepalived_vrrp[34483]: VRRP_Instance(VI_1) Entering BACKUP STATE
Keepalived_vrrp[34483]: VRRP_Instance(VI_1) removing protocol VIPs

Is there any way to see the changed priority number to look into why my machine change role state?

vrrp_script chk_nginx {
   script "killall -0 nginx"
   interval 1
   weight -2
   fall 2
   rise 1
}

Best Answer

You can use tcpdump to see the advertisements on the wire. This will show you the source machine sending the advertisement that's higher.

tcpdump -vvv -n -i eth0 host 224.0.0.18
Related Topic