I have a Master/Slave setup of Keepalived in AWS for Haproxy and EIP is being used as VIP. Once in a while backup server triggers failover yet MASTER node is healthy. Following are corresponding logs.
Backup Server
Oct 10 04:14:32 Prod-WebAccessLb2 Keepalived_vrrp[2271]: VRRP_Instance(ProdWebCluster) Transition to MASTER STATE
Oct 10 04:14:33 Prod-WebAccessLb2 Keepalived_vrrp[2271]: VRRP_Instance(ProdWebCluster) Entering MASTER STATE
Oct 10 04:14:33 Prod-WebAccessLb2 Keepalived_vrrp[2271]: Opening script file /etc/keepalived/master.sh
Oct 10 04:14:34 Prod-WebAccessLb2 Keepalived_vrrp[2271]: VRRP_Instance(ProdWebCluster) Received advert with higher priority 200, ours 100
Oct 10 04:14:34 Prod-WebAccessLb2 Keepalived_vrrp[2271]: VRRP_Instance(ProdWebCluster) Entering BACKUP STATE
Master Server
Oct 10 04:14:35 Prod-WebAccessLb1 Keepalived_vrrp[1311]: VRRP_Instance(ProdWebCluster) Received advert with lower priority 100, ours 200, forcing new election
Oct 10 04:14:35 Prod-WebAccessLb1 Keepalived_vrrp[1311]: VRRP_Instance(ProdWebCluster) Received advert with lower priority 100, ours 200, forcing new election
So after looking at logs we can say that immediately after failover, MASTER node triggers failback but it does not run master.sh and VIP left in the air.
Following are the MASTER Configs
vrrp_script chk_haproxy {
script "/bin/pidof haproxy"
interval 1
}
vrrp_instance ProdWebCluster {
debug 2
interface eth0
state MASTER
virtual_router_id 33
priority 151
unicast_src_ip 10.186.2.10
unicast_peer {
10.186.6.10
}
authentication {
auth_type PASS
auth_pass xxx
}
track_script {
chk_haproxy
}
Backup Server Configs
vrrp_instance ProdWebCluster {
debug 2
interface eth0
state BACKUP
virtual_router_id 33
priority 100
unicast_src_ip 10.186.6.10
unicast_peer {
10.186.2.10
}
authentication {
auth_type PASS
auth_pass xxxx
}
track_script {
chk_haproxy
}
Can anyone please tell why it triggers failover at first place ? and why during failback it does not run master.sh ?
Note: when i run master.sh scripts manually from Backup/Master it works the way it suppose to work.