! Configuration File for keepalived
global_defs {
router_id teacher
}
vrrp_script chk_haproxy {
script "lsof -i:80 | grep haproxy || exit 1"
interval 2
fail 1
}
vrrp_instance lvs_inst {
state MASTER
interface ens33
virtual_router_id 51
priority 250
nopreempt
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
track_script {
chk_haproxy
}
virtual_ipaddress {
10.18.42.124
}
}
本���永久更新链接地址:https://www.linuxidc.com/Linux/2018-05/152149.htm