global_defs { notification_email { xxx@exp.com } notification_email_from sns-lvs@gmail.com smtp_server 127.0.0.1 smtp_connect_timeout 30 router_id LVS_DEVEL }
vrrp_script chk_gearmand_port { script "</dev/tcp/127.0.0.1/4730" interval 3 ## 腳本檢測時間 weight -40 faill 2 rise 1 } ## 檢測時間腳本1 VIP1
vrrp_instance VI_1 { state MASTER #指定那個為master,那個為backup,如果設置了nopreempt這個值不起作用,主備考priority決定 interface eth0 #設置實例綁定的網卡 virtual_router_id 51 ##VPID標記 ,路由ID,可通過#tcpdump vrrp查看 priority 100 ##優先順序,高優先順序競選為master advert_int 1 ##檢查間隔,默認1秒 authentication { #設置認證 auth_type PASS auth_pass 1111 } virtual_ipaddress { ###設置vip 10.201.17.29 } track_script { chk_gearmand_port } # 執行上述編寫腳本 }
[火星人 ] Keepalive安裝已經有464次圍觀