Multimaster Keepalived Configuration (Virtual IP with Load Balancing)

Posted by Rad Akefirad on Server Fault See other posts from Server Fault or by Rad Akefirad
Published on 2014-08-21T09:28:12Z Indexed on 2014/08/21 10:21 UTC
Read the original article Hit count: 275

Here are requirements:
1. High Availability
2. Load Balancing

First configuration
1. Two linux servers have been configured with one static IP for each: 10.17.243.11, 10.17.243.12
2. Keepalived has been installed and configured with one VRRP instance to provide one virtual IP (10.17.243.10 as VIP, 10.17.243.11 as master and 10.17.243.12 as backup).
3. Everything works fine. The VIP is assigned to the master server (10.17.243.11) as long as it is up and running. As soon as it goes down, the VIP will be assigned to the backup server (10.17.243.12).
4. The problem here is all communication goes to the master server.

Second configuration
1. I found active-active configuration for Keepalived which is possible by defining more than one VRRP instance. So that both server have two IPs (real 10.17.243.11 and virtual 10.17.243.10 for server #1 and real 10.17.243.12 and virtual 10.17.243.20 for server #2.
2. Everything works fine. we have two VIPs which are accessible (HA). But all communication coming to each IP still goes to one single machine (either server #1 or #2 depending on the IP). However I found some tricks on the DNS to overcome this limitation. But it's not acceptable in our case.

Question:
Is there any way to have one virtual IP which is assigned to both servers? By that I mean both servers are handling some part of workload (like the thing we do in web server load balancing)? By using either keepalived or some other tools?

Thanks in advance.

© Server Fault or respective owner

Related posts about linux

Related posts about high-availability