! Configuration File for keepalived
global_defs {
router_id LVS_DEVEL
}
vrrp_script check_haproxy {
script "killall -0 haproxy"
#执行这条命令,判断返回值,该进程存在返回值为0,否则为其它
interval 3
weight -55
#如果不为0,优先级-55
fall 10
rise 2
}
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 51
priority 250
advert_int 1
authentication {
auth_type PASS
auth_pass 35f18af7190d51c9f7f78f37300a0cbd
}
virtual_ipaddress {
10.10.11.222
}
track_script {
check_haproxy
}
}