I am using 2 Nginx servers on 2 different machines with Keepalived installed respectively on both machines. Below is the configuration for both Keepalived.
MASTER KEEPALIVED
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 51
priority 150
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
track_script {
chk_http_port
}
virtual_ipaddress {
10.0.80.240
}
unicast_src_ip 10.0.80.66
unicast_peer {
10.0.80.68
}
}
vrrp_script chk_http_port {
script "pidof nginx"
interval 2
}
SLAVE KEEPALIVED
vrrp_instance VI_1 {
state BACKUP
interface eth0
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
track_script {
chk_http_port
}
virtual_ipaddress {
10.0.80.240
}
unicast_src_ip 10.0.80.68
unicast_peer {
10.0.80.66
}
}
vrrp_script chk_http_port {
script "pidof nginx"
interval 2
}
NOTE: 10.0.80.66
& 10.0.80.68
are the 2 servers having Nginx and Keepalived installed. 10.0.80.240
is the valid non assigned private IP in the network used as virtual IP here in keepalived configuration
QUESTION: When Nginx with MASTER stated Keepalived on 10.0.80.66
is down, the Keepalived does not redirect request to a Nginx instance alive on 10.0.80.68
. Is there any settings I need to do on the machines to make it happen?