title: How to make keepalived respond on failover on HAProxy?
body: <p>I am using HAProxy as load balancer for my application and to make it highly available I am using keepalive service and floating ip address concept. But whenever my primary load balancer server gets down, by removing it from network or turning it off, my all services go down instead of making secondary load balancer server available.
  My keepalived.conf for master server is,</p>
  <pre><code>global_defs
  {
          # Keepalived process identifier
          lvs_id haproxy_DH
  }
  # Script used to check if HAProxy is running
  vrrp_script check_haproxy
  {
          script &quot;pidof haproxy&quot;
          interval 2
          weight 2
  }
  # Virtual interface
  vrrp_instance VI_01
  {
          state MASTER
          interface eno16777984           #here eth0 is the name of network interface
          virtual_router_id 51
          priority 101
          # The virtual ip address shared between the two loadbalancers
          virtual_ipaddress {
                  172.16.231.162
          }
          track_script {
                  check_haproxy
          }
  }
  </code></pre>
  <p>For backup server it is like,</p>
  <pre><code>global_defs
  {
          # Keepalived process identifier
          lvs_id haproxy_DH_passive
  }
  # Script used to check if HAProxy is running
  vrrp_script check_haproxy
  {
          script &quot;pidof haproxy&quot;
          interval 2
          weight 2
  }
  # Virtual interface
  vrrp_instance VI_01
  {
          state BACKUP
          interface eno16777984           #here eth0 is the name of network interface
          virtual_router_id 51
          priority 100
          # The virtual ip address shared between the two loadbalancers
          virtual_ipaddress {
                  172.16.231.162
          }
          track_script {
                  check_haproxy
          }
  }
  </code></pre>
  <p>The virtual IP address is assigned and working when both load balancers are up. But whenever machine goes down, my service also goes down. I am using CentOS7, Please help.</p>