! Configuration File for keepalived global_defs { router_id LVS_DEVEL script_user root enable_script_security } vrrp_script chk_haproxy { script "/etc/keepalived/keepalived.check.sh" interval 5 weight -5 fall 2 rise 1 } vrrp_instance VI_1 { state MASTER interface eth0 # 本机网卡名称 virtual_router_id 51 priority 10X advert_int 2 authentication { auth_type PASS auth_pass K8SHA_KA_AUTH } virtual_ipaddress { 192.168.1.XX # VIP地址,需要是宿主机同网段且不存在的IP地址 } track_script { chk_haproxy } }