Skip to content

Instantly share code, notes, and snippets.

@soleil0-0
Forked from mrlesmithjr/keepalived.conf
Last active December 24, 2019 07:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soleil0-0/c5d241635e1261d6876e5189fa78cc88 to your computer and use it in GitHub Desktop.
Save soleil0-0/c5d241635e1261d6876e5189fa78cc88 to your computer and use it in GitHub Desktop.
vrrp_script chk_haproxy {
script "killall -0 haproxy" # verify the pid existance. `killall -0 haproxy` or `pidof haproxy`
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