when using keepalive, it is found that the vrrp_scrpt
script has not been executed. The configuration is as follows:
by configuration, when / etc/keepalived/down
exists, the priority of MASTER drops to 80, but the script never triggers.
MASTER
! Configuration File for keepalived
global_defs {
notification_email {
root@localhost
}
notification_email_from keepalived@localhost
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id LVS
}
vrrp_script chkdown {
script "[[ -f /etc/keepalived/down ]] && exit 1 || exit 0"
interval 1
weight -20
fall 1
rise 1
}
vrrp_instance VI_1 {
state MASTER
interface ens33
virtual_router_id 151
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 486fcd6f30e1
}
track_script {
chkdown
}
virtual_ipaddress {
192.168.101.231/24 dev ens33 label ens33:0
}
debug
}
BACKUP
! Configuration File for keepalived
global_defs {
notification_email {
root@localhost
}
notification_email_from keepalived@localhost
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id LVS
}
vrrp_script chkdown {
script "[[ -f /etc/keepalived/down ]] && exit 1 || exit 0"
interval 1
weight -20
fall 1
rise 1
}
vrrp_instance VI_1 {
state BACKUP
interface ens33
virtual_router_id 151
priority 90
advert_int 1
authentication {
auth_type PASS
auth_pass 486fcd6f30e1
}
track_script {
chkdown
}
virtual_ipaddress {
192.168.101.231/24 dev ens33 label ens33:0
}
debug
}