Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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!

share|improve this question
    
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 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
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 1: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 2: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-) serverfault.com/questions/350086/… –  user53864 Jan 15 '12 at 15:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.