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?

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.

Leave a Comment