Vrrp_script Chk_sshd { Script "killall-0 sshd" # cheaper than pidof Interval 2 # Check every 2 seconds Weight-4 # Default Prio:-4 if KO } Vrrp_script Chk_haproxy { Script "killall-0 haproxy" # cheaper than pidof Interval 2 # Check every 2 seconds } Vrrp_script Chk_http_port { Script "/TCP/127.0.0.1/80" # Connects and exits Interval 1 # Check every second Weight-2 # Default Prio:-2 if Connect fails } Vrrp_script Chk_https_port { Script "/tcp/127.0.0.1/443" Interval 1 Weight-2 } Vrrp_script Chk_smtp_port { Script "/TCP/127.0.0.1/25" Interval 1 Weight-2 } Vrrp_instance Vi_1 { Interface eth0 State MASTER VIRTUAL_ROUTER_ID 51 Priority 100 virtual_ipaddress { 192.168.200.18/25 } Track_interface { eth1 Weight 2 # prio = +2 if up Eth2 weight-2 # prio =-2 if down Eth3 # no weight, fault if down } Track_script { CHK_SSHD # Use default weight the script Chk_haproxy Weight 2 # +2 If process is present Chk_http_port Chk_https_port Chk_smtp_port } } Vrrp_instance Vi_2 { Interface eth1 State MASTER VIRTUAL_ROUTER_ID 52 Priority 100 virtual_ipaddress { 192.168.201.18/26 } Track_interface { Eth0 Weight 2 # prio = +2 if up Eth2 weight-2 # prio =-2 if down Eth3 # no weight, fault if down } Track_script { Chk_haproxy Weight 2 Chk_http_port Chk_https_port Chk_smtp_port } } |