Hi, first of all here's some details.
Server1 running haproxy with keepalived (MASTER): CentOS 7
Server2 running haproxy with keepalived (BACKUP): CentOS 7
My problem is that whenever I stop haproxy the VIP is not transferring from master server to backup server.
Here is the configs:
MASTER:
Code:
vrrp_script chk_http_port {
script "/usr/bin/killall -0 haproxy"
interval 2
weight 2
}
vrrp_instance VI_1 {
state MASTER
interface enp0s3
virtual_router_id 51
priority 150
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
unicast_src_ip 192.168.1.51 # IP address of local interface
unicast_peer { # IP address of peer interface
192.168.1.52
}
track_script {
chk_http_port
}
virtual_ipaddress {
192.168.1.200/24 dev enp0s3
}
}
BACKUP:
Code:
vrrp_script chk_http_port {
script "/usr/bin/killall -0 haproxy"
interval 2
weight 2
}
vrrp_instance VI_1 {
state BACKUP
interface enp0s3
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
unicast_src_ip 192.168.1.52 # IP address of local interface
unicast_peer { # IP address of peer interface
192.168.1.51
}
track_script {
chk_http_port
}
virtual_ipaddress {
192.168.1.200/24 dev enp0s3
}
}