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.

When my A web server gets unplugged, how do I automatically redirect all the users to my B web server in another city, and vice versa?

A load-balancing switch does what I want, except I can't figure out how to get it to work unless both web servers are in the same building.

The high-availability clustering systems do what I want, except I can't figure out how to get it to work unless both web servers are in the same building.

The accepted answer to " redirect to a static page on another web server when main web server is down " seems to support web servers in 2 different cities. But how does installing a piece of software on one box help me after that box is unplugged?

How do round-robin DNS and content-delivery networks (CDNs) do it?

I suppose one approach starts out something like:

  1. I get the IP address of each and every one of my physical web servers.
  2. I put the IP address of each and every one of my physical web servers into the DNS record for the single domain name of "the" web site (multiple A records or AAAA records or both).
  3. ... then what do I need to do?

I suppose another approach starts out something like

  1. I use some dynamic DNS provider for the single domain name that I expect users to type into the web browser
  2. I set up a cron job on each web server that periodically tells the DNS provider its own IP address (update the A record or AAAA record) or its own domain name (update the CNAME record or DNAME record).
  3. ... then what do I need to do?

(For now, I'd be happy if my users got a static web page with my contact information and a footnote that says "the main A web server seems to be down" whenever web server A is unplugged. That's already much better than the current system that merely gives a "server not found" error. Ideally I'd like A and B to be fully synchronized and apparently identical -- but that's something for another question: equivalent to CDN but for dynamical content? ).

share|improve this question
    
related: “Simple” Failover to a Geographically Separated Server? (possibly duplicate?) –  David Cary Jul 4 '12 at 14:05
add comment

5 Answers

Sounds like you may be looking for a Global Server Load Balancing (GSLB) solution. GSLB usually uses "smart" DNS to direct users to different servers based on a number of parameters (i.e. server unavailable, high load, ip geolocation, etc).

As an example, say you have two web servers, one out west (10.10.10.1/24) and one east (10.20.20.1/24). Say your web hostname is www.connect.com.

GSLB can be configured to be your DNS or as a CNAME. Either way, a user types in www.connect.com, the dns query is directed to the GSLB solution and it responds with either 10.10.10.1 or 10.20.20.1 depending on parameters. The GSLB usually sets a low TTL so the client host/browser caches the response for as little time as possible. There are different ways to address persistence but that goes beyond the scope of this scenario.

Lets say the east (10.20.20.1) web server goes down. GSLB usually implements health checks to check the health of the backend nodes. GSLB notices east is down and all subsequent dns records for www.connect.com will resolve to 10.10.10.1.

If you have a local server load balancing solution (SLB), then you could set it up such that www.connect.com is a VIP/VS (say 192.168.1.1/24) with two backend nodes (10.10.10.1/24 and 10.20.20.1/24). Technically the nodes could be in different network segments so as long as the local SLB can reach the other server. The SLB solution may be smart enough to redirect users to an available server if a backend node goes down. If you're using F5 LTM, then you could easily create an iRule for such an event. Citrix NetScaler and other SLB solutions should also have similar capabilities.

RR DNS does not work in this case. RR DNS has no intelligence built in. The only way to accomplish the use case with DNS is to use some sort of "smart" dns through a GSLB (or similar) solution.

CDN usually implement GSLB/SLB solutions to ensure HA for their customers.

share|improve this answer
    
David: Besides F5 ans cisco which are appliances, you can have it as a service, like tzoha, edgedirector and dnshat –  Sandman4 Apr 27 '12 at 6:13
    
Actually, F5, Citrix/NetScaler both offer virtual appliances for GSLB. A10, radware, zeus, brocade, alteon, and others may very well offer virtual appliances as well. But you're absolutely right that there are GLSB SaaS service providers out there. Probably easier on the pocket book by using opex instead of capex to build infrastructure but SaaS models aren't without its risks (i.e. SLA, operational, support). I've never heard of edgedirector or dnshat, but they are both competitively priced! –  bangdang Apr 27 '12 at 16:34
1  
I've been told that "global server load balancing {causes} reduced high availability." compared to multiple A records. I've been told that "10.10.10.1" or "192.168.1.1" or other private network addresses don't work over the public Internet. I've been told that all local server balancing systems either (a) require all the web servers to be in the same building; or else (b) have a single point of failure; both of which I should avoid in a HA system. Is there any way to avoid these problems? –  David Cary Jun 12 '12 at 15:15
add comment

You want to look into global load balancers like F5 and Cisco make. Basically they do some tricks with DNS if the partner is down and if the partner is up they feed the data across to the otherside through the load balancer.

share|improve this answer
add comment

Another cheap, quick and reliable solution to evaluate could be to use Amazon Route 53 failover http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/health-checks-creating.html. This feature was released on Feb 11 2013 and provides high availability and/or load balancing between primary and secondary sites.

Asim

share|improve this answer
add comment

Tell me if you are using any sort of reverse proxy in your environment if so u might be able to redirect it to the backup server.

if not then F5 is a good idea to use.

also if u have register the domain with a 3rd party domain registrar u can get the DNS server config to redirect to new server or backup server.

share|improve this answer
add comment

You can do this without using a network appliance using the following two methods at least, but they will require change control:

  • Reverse proxy, you'll need to remove the server you're going to unplug from the candidates of the proxy

  • DNS, you'll have to plan ahead, change DNS and wait for the TTL to pass

You can also do automatic load balancing and active-active failover, especially for a web server serving static pages by using routing protocols. Checkout EGP and IGRP. There should be help material online (related to Cisco especially) that detail how to do this with two or more hosts via a router.

share|improve this answer
add 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.