Skip to content

Instantly share code, notes, and snippets.

@unicorn667
Created December 4, 2017 09:55
Show Gist options
  • Select an option

  • Save unicorn667/231eff9b2469b83f2366c930778a8a69 to your computer and use it in GitHub Desktop.

Select an option

Save unicorn667/231eff9b2469b83f2366c930778a8a69 to your computer and use it in GitHub Desktop.

Revisions

  1. unicorn667 created this gist Dec 4, 2017.
    24 changes: 24 additions & 0 deletions keepalived.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    # Keepalived process identifier
    lvs_id haproxy_DH
    }
    # Script used to check if HAProxy is running
    vrrp_script check_haproxy {
    script "killall -0 haproxy"
    interval 2
    weight 2
    }
    # Virtual interface
    # The priority specifies the order in which the assigned interface to take over in a failover
    vrrp_instance VI_01 {
    state MASTER
    interface eth0
    virtual_router_id 51
    priority 101
    # The virtual ip address shared between the two loadbalancers
    virtual_ipaddress {
    10.10.11.20
    }
    track_script {
    check_haproxy
    }
    }