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 2 physical servers, each with 32GB RAM and 2 quad core procs. Each will run VMWare, 4 VMs each, one DB, 1 app server, 1 task queue server, and one general purpose server. One will run my web application. The other will constantly replicate synchronously from the primary server, to provide a fail-over that's ready to go with all data, etc. I want to use HAProxy to handle fail-over, in the case of a server issue in the primary server, but I'm uncertain whether this is possible to achieve while only using these two physical servers. Is it? If not, is there another solution which doesn't require me to purchase another piece of equipment?

share|improve this question
1  
If you're using VMWare why would you use HAProxy instead of the VMWare capabilities like VMWare HA cluster and Fault Tolerance? –  HTTP500 Apr 22 '12 at 15:42
    
Unrelated to your question, just wandering - why you need VMs at all ?! Can't all this servers coexist on one machine ? –  Sandman4 Apr 22 '12 at 16:17
    
Because it is vastly more expensive to set that up properly without simply shifting a SPoF to shared storage? –  JamesRyan Apr 22 '12 at 20:10
    
@JamesRyan - vastly more expensive to set up VMWare VMs, or? I didn't understand your question. –  orokusaki Apr 23 '12 at 0:48
    
sorry, I was replying to HTTP500 –  JamesRyan Apr 23 '12 at 9:08
show 1 more comment

1 Answer 1

up vote 5 down vote accepted

You can run haproxy on the same two physical machines with a high availability solution such as keepalived. The virtual IP will be moved between the two machines in case of the master failure. Clearly, the users will request the service via the VIP which will be held by the master machine.

share|improve this answer
    
thanks. Does this require any third piece of physical equipment which routes the requests to the master, and then the slave if the master is dead (or does it require a physical 3rd part, due to some other reason)? If not, how is it possible? –  orokusaki Apr 22 '12 at 15:02
    
using heartbeats –  JamesRyan Apr 22 '12 at 20:15
    
@JamesRyan - how does the heartbeat allow you to not need a third piece (e.g. load balancer, etc.). If all requests go to server A and then server A breaks, how do all the requests suddenly go to server B without a 3rd piece saying "server A heart beat stopped, send traffic to B"? –  orokusaki Apr 23 '12 at 1:21
    
@orokusaki: Your machines will be assigned two IP addresses. The users will not request the service using any of these IPs, but the service will be requested via a third IP address (called VIP). This virtual IP will be assigned by the high availability solution (like keepalived or heartbeat) to the active machine. If that machine breaks, the VIP will be automatically "moved" to the other machine. –  Khaled Apr 23 '12 at 7:04
    
This usually either works by one machine taking over a virtual ip from the other or by both receiving all the packets and only one responding at a time. High availability and load balancing are related but not the same thing. –  JamesRyan Apr 23 '12 at 9:11
show 1 more comment

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.