Hello,
I thought these questions are solved with using keepalived and the vrrp_script?
How does the cluster "know" that a failure has happened?
--> When the vrrp_script returns != 0
What does it do when this falure has happened?
--> passing the vIP to the other host.
Please see the complete config here:
reverse1:
Code: Select all
! Configuration File for keepalived
global_defs {
notification_email {
<mailaddress>
}
notification_email_from reverse1
smtp_server <relayhost>
smtp_connect_timeout 30
router_id LVS_DEVEL
}
vrrp_script chk_nginx {
script "/usr/bin/killall -0 nginx"
interval 2
weight 2
fall 2
rise 2
}
vrrp_instance VI_1 {
state MASTER
interface ens192
virtual_router_id 51
priority 101
advert_int 1
authentication {
auth_type PASS
auth_pass <password>
}
track_script {
chk_nginx
}
virtual_ipaddress {
<vIP>
}
}
and reverse2:
Code: Select all
! Configuration File for keepalived
global_defs {
notification_email {
<mail-address>
}
notification_email_from reverse2
smtp_server <relayhost>
smtp_connect_timeout 30
router_id LVS_DEVEL
}
vrrp_script chk_nginx {
script "/usr/bin/killall -0 nginx"
interval 2
weight 2
fall 2
rise 2
}
vrrp_instance VI_1 {
state MASTER
interface ens192
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass <password>
}
track_script {
chk_nginx
}
virtual_ipaddress {
<vIP>
}
}