-3

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?

EGr
  • 609
  • 4
  • 14
  • 29

2 Answers2

2

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.

Petter H
  • 3,443
  • 1
  • 16
  • 19
  • `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
0

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.

Nils
  • 7,695
  • 3
  • 34
  • 73