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 two VMs in VirtualBox that use NAT for their network adapters. They are both getting the same IP address, so I will need to reconfigure that; but knowing that, is it possible to set up a heartbeat agent to failover an apache server if one of the two VMs go down?

The way I pictured it would be that the webserver would be able to be accessed externally via :80. No matter what VM was running, I would be able to access the website at that IP/port since failover would be setup.

I'm running into trouble setting up IPs when the network adapters are set to NAT, and people have told me that I shouldn't be setting the IPs in this configuration. So what should I do to achieve what I'm looking for? Is it even feasible?

share|improve this question
2  
You shouldn't be using VirtualBox for anything important, either. –  Michael Hampton Oct 19 '13 at 17:19
    
The systems aren't actually important, I just wanted to see if I could set up a failover like this. –  EGr Oct 19 '13 at 22:34
add comment

closed as off-topic by MadHatter, Dennis Kaarsemaker, Falcon Momot, Ward, Jenny D Jan 2 at 9:24

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is dedicated to professional system and network administrators. End user and enthusiast questions are off-topic (contact your system administrator or hire a professional to help you out). Please see the Help Center for more information." – MadHatter, Dennis Kaarsemaker, Falcon Momot, Ward, Jenny D
If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

The most common approach is sticking the web servers behind a load balancer and leaving the services running on both. You setup both Active/Passive and Active/Active depending on your requirements.

If you can't afford, or don't want to buy physical load balancers, then you can achieve what you are requesting by:

  • setting up something like piranha, assuming you are running linux. It is possible to use the same machines as those running web server for this.

  • or you can cluster them with RHCS, again, assuming you are running linux.

The possibilities are endless.

share|improve this answer
    
lvs would be another LB solution. But how to make these LBs HA? So active/passive is normally easier, if active/active is not needed. –  Nils Dec 30 '13 at 10:11
add comment

Easy. You need a logical service-IP for your webservice.

That being done your resource-group consists of two items:

  • logical IP
  • httpd

Make sure you have enough heartbeat-lines so the cluster "knows" for sure that the other node is down before failing over.

share|improve this answer
add comment

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