Hello,
I am trying to configure haproxy with keepalived.
I followed this guide https://www.certdepot.net/rhel7-configure-high-available-load-balancer/
I have haproxy running on both centos 7 vms.
The issue is that the vip ip address starts on both vms as soon as I start keepalived service.
My understanding is that when haproxy and keepalived is running on both vms, only the primary server should have the vip started. However, it starts on both as soon as I start keepalived.
below is the config
master:
cat keepalived.conf
vrrp_script chk_haproxy {
script "killall -0 haproxy"
interval 2
}
vrrp_instance VI_1 {
interface eth0
state MASTER
virtual_router_id 51
priority 101
virtual_ipaddress {
10.143.19.249
}
track_script {
chk_haproxy
}
}
secondary:
cat keepalived.conf
vrrp_script chk_haproxy {
script "killall -0 haproxy"
interval 2
}
vrrp_instance VI_1 {
interface eth0
state BACKUP
virtual_router_id 51
priority 100
virtual_ipaddress {
10.143.19.249
}
track_script {
chk_haproxy
}
}