Ubuntu – Heartbeat ip failover on Ubuntu

failoverheartbeatipUbuntuweb-server

I have 3 servers, 1 as load balancer and 2 as web-servers(apache tomcat) hosting some jsp pages. I want to add one more load balancer in active/passive mode to avoid SPOF and below is the expected setup.

lb1--> eth0=123.123.123.123, eth1=192.168.1.5
web1--> eth1=192.168.1.6
web2--> eth1=192.168.1.7

lb2--> eth0=123.123.123.124, eth1=192.168.1.8

I have seen many heartbeat configuration to do this but I am not sure in case of virtual ip sharing where I am trying to achieve this without any more ip or ip sharing request(Rackspace). Generally it's said floating/virtual ip is the public ip in the haresource file which is shared between the lbs and I am asking is there any possibility to do this with virtual private ip to avoid one more public ip cost. But the final output should be, lb2 should be answering on behalf of lb1 if lb1 is down.

And one more thing to be considered is, all the registered DNS domain names(site names) are pointed to public ip(123.123.123.123) of lb1 where it redirect to backend web servers(ofcourse I know that same config is maintained on lb2). Anybody has any hints to achieve this without requesting one more public ip if possible with the above minimal setup. I'm new to heartbeat!

Thanks in Advance!

Best Answer

Configure both LBs to listen on the same public IP address. The passive LB will watch for the active LB to fail and start handling requests when the active LB goes down.

Points to remember:

  • The upstream link and router will remain a single point of failure.
  • If both LBs go active you will likely have access problems.

EDIT: If each LB has a public IP address then you really want an active/active configuration. Otherwise, you are likely to fail to respond to half your requests. Active/passive should be using a single IP address for incoming traffic. The passive node does an address takeover when the active node dies.

In Active/Active mode, both LBs will have different public IPs. Normally, there would be one or more DNS names with both IPs listed in their entries. Simpler systems will use normal DNS round robin balancing between the two LBs. More complex systems will use short TTLs on the DNS entries and try to balance the load by handing out the address of the least busy LB as the first DNS entry.

In Active/Passive mode, both LBs handle the same public IP address (with only the current active note passing traffic for that address). There are a variety of heartbeat monitoring techniques that can be used by the passive node to monitor the active node.