Scenario:
- You have at least two datacenters running the same application. The primary datacenter is always active. In case of failure/disaster the secondary/backup datacenter must kick in taking control and providing access to your application (disaster recovery)
- Your application is mapped on a well-defined hostname (ie. www.myapplication.com)
- On the primary datacenter www.myapplication.com is running on IP a.b.c.d. One the secondary/backup datacenter www.myapplication.com is running on IP x.y.z.t
- You need your clients traffic to be sent to the primary datacenter and, only in case of unavailability, be transparently sent to the secondary/backup datacenter
Solution:
- Use GSLB.me in priority balancing mode
- Define one geohost that will be pointed by www.myapplication.com via a DNS CNAME record
- Create two targets, one for each datacenter
- Assign the relevant checks to each target
- Configure the CNAME record on the primary DNS server that handles the domain myapplication.com
How to configure it:
- Register on GSLB.me and log on
- Select under which one of the available domains (gslb.us, gslb.info, …) you want to create your geohost. You can choose the domain you prefer, this is purely a “cosmetic” choice. Let’s choose myapplication.gslb.info
- Create your geohost: a geohost is the FQDN (Fully Qualified Domain Name) that your authoritative DNS will use as a CNAME for your application hostname (ie. www.myapplication.com). Select “Priority” as your balancing algorithm. This will enable active-standby distribution of incoming traffic towards your datacenters.
- Define the first target: the target’s IP address is a.b.c.d and its priority must be 1
- Select checks to be performed on the first target
- Define the second target: the target’s IP address is x.y.z.t and its priority must be any number higher than 1. This allows the “priority” balancing algorithm to handle active-standby.
- Select checks to be performed on the second target
- Configure your authoritative DNS to use a CNAME record to have www.myapplication.com point to myapplication.gslb.info