Keepalived failover not working – how to configure master / failover

failoverhaproxyhigh-availabilitykeepalived

I have following two server setup running:
node1: keepadlived master -> HAProxy -> Apache
node2: keepadlived failover -> HAProxy -> Apache

The system works perfectly until I shut down keepalived master. Then the site is entirly down. This is where failover with the other keepalived should come in place, but this never happens.

If I shutdown node1 completly and reboot node2 then the system works, so the setup of node2 including keepalived is OK.

This is my config:

! Configuration File for keepalived

vrrp_script chk_haproxy {           # Requires keepalived-1.1.13
        script "killall -0 haproxy"     # cheaper than pidof
        interval 2                      # check every 2 seconds
        weight 2                        # add 2 points of prio if OK
}

vrrp_instance VI_1 {
    state MASTER
    interface eth0
    virtual_router_id 51
    priority 100        # 101 on master; 100 on backup
    virtual_ipaddress {
        192.168.56.150 #vip1 br0:100
        192.168.56.151 #vip2 br0:101
    }
    track_script {
        chk_haproxy
    }

}

Thank you in advance for any help!

Best Answer

It looks like the problem is resolved. Both VMs had idendical MAC-Adresses for there network interfaces. Changed that, rebooted, works.