12

I'm about to convert a single-server single-database web application into a physically distributed high-available configuration with servers on two physical locations (for now). Now, obviously, I need a load balancer (more like a reverse proxy in this case, but I'll call it "load balancer" for simplicity), which would route requests for mywebsite to either node1.mywebsite or node2.mywebsite. However, I assume that high-available servers are no use if my load balancer goes down. Therefore, so my train of thought, I'd actually need two load balancers, one on each location. However, I'd still want a single external point of access, therefore I'd need a load balancer for the load balancers, which in turn would need to be balanced across locations... this goes on and on.

So what's wrong with my reasoning? How would I ensure high availability of my load balancers in practice, assuming each of the physical locations could be disconnected from power for a long period of time?

PS: I'm aware of the fact that my understanding of the distinction between HA and load-balancing is mediocre at best. What I want is an available server even when the power on one location goes down. Thank you for your understanding.

3
  • 1
    Have you investigated IP failover? If both datacenters are the same provider it should be reasonably straight forward
    – user80776
    Nov 30, 2011 at 14:14
  • You must have your nodes on separate networks ? - When it's on the same LAN, HA is easier to setup.
    – Sandman4
    Nov 30, 2011 at 18:43
  • What is your main goal - you want load-balancing meaning you want to handle loads higher than those that are ok for single server, or you want HA meaning that you want your site work even if single node fails ?
    – Sandman4
    Nov 30, 2011 at 18:52

3 Answers 3

4

You can't, which is why load-balancing has nothing to do with availability.

2

Two load balancers should be enough. You will be using only one load balancer at a time. The name mywebsite should resolve to the VIP assigned to one of the load balancers.

2
  • is VIP = virtual IP? Which part of infrastructure would be hosting the VIP routing, i.e. detect that one LB is down and route to the other? If it's on one of the locations, it could be down as well... Nov 30, 2011 at 14:22
  • With a VIP the requests go to both LBs and one of them decides to respond based on whether it thinks the other one is up. This would suggest they arn't geographically seperated though which is a whole other level of availability.
    – JamesRyan
    Nov 30, 2011 at 15:51
2

You can do coarse HA and balancing with round robin dns by sticking it in front of your load balancers.

9
  • 1
    Round robin will do load-balancing, but as for HA - NO. Basically browser will choose one of the nodes and stick to it. It have 50% chances to hit a good one or a bad one.
    – Sandman4
    Nov 30, 2011 at 18:48
  • No, this is not what happens. Most modern browsers will take all the IPs including the bad one and transparently retry from the good ones. It is not foolproof but will work for the vast majority of users.
    – JamesRyan
    Dec 1, 2011 at 11:32
  • 1
    what makes you think so ? I also hoped so until I actually tested it myself. Both firefox and chrome will try 1-st IP for 180 seconds, then switch to next IP. Once you go to next page, they will start with 1-st (non-responsive) IP again and wait another 180 seconds and so on. ( serverfault.com/questions/327708/… )
    – Sandman4
    Dec 1, 2011 at 14:42
  • 1
    Yuck. We can go on saying "it does" or "it doesn't". Just TRY it and see. And clicking refresh changes nothing (at least in chrome) - you wait 180 seconds even if you click stop and open the page again.
    – Sandman4
    Dec 1, 2011 at 18:58
  • 1
    @Cylindric I did NOT suggest using DNS for HA.
    – Sandman4
    Dec 7, 2011 at 13:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .