Topics

Multiple Interfaces with keepalived for failover

Bhaskar Singhal
 

Hello,

I am trying to configure keepalived with load balancing. I have four VMs which are supposed to share the load and also own the floating virtual IP address.

But I am worried about the split brain case, where the virtual IP address might get configured on two different VMs (because two instances think they are master).

Is there a way to use multiple interfaces to ensure if there is some issue with one interface, the failover doesn't happen. Failover should only happen when both interfaces indicate a problem.

My keepalived.conf for reference:

# Configuration File for keepalived
vrrp_instance VI_150.50.2.144 {
        state BACKUP
        interface eth1
        virtual_router_id 54
        priority 100
        advert_int 1
        authentication {
                auth_type PASS
                auth_pass k@l!ve1
        }
        virtual_ipaddress {
                150.50.2.144/24
        }
        track_interface {
                eth0 weight -5
                eth1 weight -5
        }
}

# Virtual Servers definitions
virtual_server 150.50.2.144 443 {
        delay_loop 20
        lb_algo wrr
        lb_kind NAT
        protocol TCP
        real_server 150.50.2.132 443 {
                weight 8
        }
        real_server 150.50.2.136 443 {
                weight 100
        }
        real_server 150.50.2.133 443 {
                weight 8
        }
        real_server 150.50.2.108 443 {
                weight 100
        }
}
 
The similar config file is present on all four VMs (with different priorities).
Keepalived v1.3.9 (10/21,2017)

Any suggestions?

Regards,
Bhaskar