I have keepalived attempting to hold a vip in master/slave configuration on 2 servers.
Master config:
vrrp_script chk_haproxy {
script "/usr/bin/killall -0 haproxy"
interval 2
weight 2
}
vrrp_instance NAME {
interface ens224
state MASTER
virtual_router_id 70
priority 104
virtual_ipaddress {
SOME_IP
}
track_script {
chk_haproxy
}
}
Slave config:
vrrp_script chk_haproxy {
script "/usr/bin/killall -0 haproxy"
interval 2
weight 2
}
vrrp_instance scc_elastic {
interface ens224
state BACKUP
virtual_router_id 70
priority 103
virtual_ipaddress {
SOME_IP
}
track_script {
chk_haproxy
}
}
But this is causing split brain.. i.e. each one of the servers are showing the ip show up under "ip addr show" How can I prevent this from happening? I am not sure how to diagnose this. I dont have much network expertise.
I looked at the ip tables:
Chain INPUT (policy ACCEPT) target prot opt source destination
Chain FORWARD (policy ACCEPT) target prot opt source destination
Chain OUTPUT (policy ACCEPT) target prot opt source destination
No rules present.