https://blog.csdn.net/u010020099/article/details/82116474
! Configuration File for keepalived global_defs { router_id LVS_1 } vrrp_script chk_http_port { script "/usr/local/src/chk_nginx_pid.sh" #心跳执行的脚本 interval 2 #(检测脚本执行的间隔,单位是秒) weight 2 } vrrp_instance VI_1 { state MASTER interface eth0 #系统网卡 virtual_router_id 51 #主备两机器一致 priority 100 #值大的机器,胜出 advert_int 1 authentication { auth_type PASS auth_pass 1111 } track_script { chk_http_port #(调用检测脚本) } virtual_ipaddress { #可虚拟多个ip 192.168.244.200 } }