Skip to content

Instantly share code, notes, and snippets.

@mrlesmithjr
Last active December 24, 2019 07:13
Show Gist options
  • Save mrlesmithjr/9b11490f45c602726f81 to your computer and use it in GitHub Desktop.
Save mrlesmithjr/9b11490f45c602726f81 to your computer and use it in GitHub Desktop.
vrrp_script chk_haproxy {
script "killall -0 haproxy" # verify the pid existance
interval 2 # check every 2 seconds
weight 2 # add 2 points of prio if OK
}
vrrp_instance VI_1 {
interface eth0 # interface to monitor
state MASTER
virtual_router_id 51 # Assign one ID for this route
priority 101 # 101 on master, 100 on backup (Make sure to change this on HAPROXY node2)
virtual_ipaddress {
10.0.101.60 # the virtual IP's
}
track_script {
chk_haproxy
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment