1

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!

user53864
  • 1,653
  • 8
  • 36
  • 66
  • What is reliable way to do this with minimal cost of public ip?, when made a request to share the ip between nodes, what they generally do? – user53864 Jan 10 '12 at 17:32

1 Answers1

1

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.

BillThor
  • 27,354
  • 3
  • 35
  • 69
  • `Configure both LBs to listen on the same public IP address` means in heartbeat configuration watching lb1's ip address?. What could be the best solution to avoid both points with minimal cost as much as possible. – user53864 Jan 10 '12 at 01:11
  • Let suppose two LBs has no public ip assigned and I'm sharing a single public ip between two LBs, what if heartbeat malfunction/corrupt either way? what steps I will have to take soon after to get my sites up – user53864 Jan 10 '12 at 17:37
  • If either LB malfunctions, it is best to take that one down. If the configuration is correct the other should take over all the load. My preference would be to configure both to be passive if the other is handling the load. You can then recycle whichever LB has problems and it should restart in passive mode. Configuration errors with Active/Passive LBs can cause significant problems. – BillThor Jan 10 '12 at 21:23
  • Thanks Bill. A small confusing from you EDIT, if each LB has unique public ip even then it will be acting as a active/passive mode as the additional public ip is shared between them and is only assigned to any one node and all the domain name are registered to this shared public ip. I am a bit not sure that what config makes it Active/Active. – user53864 Jan 11 '12 at 02:15
  • Nice answer, it took some time to understand and for active/active, pacemaker should also be integrated and I don't know if it's possible by heartbeat alone. If I want to add one more lb(3 nodes), how do I do this, if possible please post here-) http://serverfault.com/questions/350086/heartbeat-pacemaker-3-node-ip-failover – user53864 Jan 15 '12 at 15:50
  • @user53864 Before you get to three load balancers, you should likely be to the point where you have a dozen or more web servers, and possibly a multi-site configuration. By then you will have yourself, or have hired the necessary expertise. – BillThor Jan 15 '12 at 15:56