Datacenter failover
While you can use geolocation-based load balancing to route traffic to the datacenter nearest to the client, you can also use HAProxy ALOHA for basic failover and failback between datacenters without the geolocation component. If a critical resource fails and service is disrupted, traffic is automatically redirected to healthy datacenters. This minimizes impact and avoids intervention.

Normal operation | Failover | ||
---|---|---|---|
I | A client asks for the IP address associated with the www.example.com domain name. | A | A client for the IP address associated with the www.example.com domain name. |
II | HAProxy ALOHA returns the IP address of the first datacenter on the list since it is up and running. | B | HAProxy ALOHA returns the IP address of the next healthy datacenter on the list. |
III | The client is directed to the first datacenter on the list. | C | The client is directed to the next healthy datacenter on the list. |
-
In the Services tab, click gslb setup.
Add a
listen
directive for each IP address/network port pair at which the GSLB should listen for DNS queries. By default, it listens on all IP addresses (0.0.0.0) at port 53.To enable the service to start automatically when the appliance boots, delete the no autostart line, click OK and then Close.
-
In the Services tab, click [advanced mode]. Then edit the gslb configuration.
The current configuration displays.
zone mydomain.com ttl 10 # ORIGIN records record @ SOA ns1.mydomain.com hostmaster.mydomain.com 1 86400 3600 3600 3600 60 record @ NS ns1.mydomain.com record @ ttl 3600 MX 100 mail1.mydomain.com # static records record ns1 ttl 10 A 10.0.0.1 record mail1 ttl 10 A 10.0.0.2
-
Add a new
list
record directive to thezone
section. This type of record specifies a list of space-separatedanswer-list
names. Essentially, you are specifying datacenters in order of preference, with fallback datacenters following primary datacenters.The list record www enumerates two
answer-list
sections, DC1 and DC2, where DC1 is the primary datacenter and DC2 is the fallback. You could list additional fallback datacenters too.zone mydomain.com ttl 10 # ORIGIN records record @ SOA ns1.mydomain.com hostmaster.mydomain.com 1 86400 3600 3600 3600 60 record @ NS ns1.mydomain.com record @ ttl 3600 MX 100 mail1.mydomain.com # static records record ns1 ttl 10 A 10.0.0.1 record mail1 ttl 10 A 10.0.0.2 # dynamic records - DC1 is primary, DC2 is a fallback record www ttl 30 list DC1 DC2
-
Create
answer-list
sections that match the names you listed on thelist
record in thezone
section.We define two
answer-list
sections named DC1 and DC2. These return DNS records to the client for different datacenters.zone mydomain.com ttl 10 # ORIGIN records record @ SOA ns1.mydomain.com hostmaster.mydomain.com 1 86400 3600 3600 3600 60 record @ NS ns1.mydomain.com record @ ttl 3600 MX 100 mail1.mydomain.com # static records record ns1 ttl 10 A 10.0.0.1 record mail1 ttl 10 A 10.0.0.2 # dynamic records record www ttl 30 list DC1 DC2 answer-list DC1 up_threshold 1 method multi-up option httpchk http-check connect http-check send uri
/health.htmlhdr host www.mydomain.com http-check expect status 200,301,302 answer-record srv1 20.0.0.1 answer-list DC2 up_threshold 1 method multi-up option httpchk http-check connect http-check send uri/health.htmlhdr host www.mydomain.com answer-record srv1 30.0.0.1The
answer-list
section directives syntax is as follows.Directive
Description
up_threshold
Determines the percentage of servers that must be up. Otherwise, traffic is routed to a different datacenter altogether. A threshold of 1 means that all servers in an
answer-list
must be healthy for the corresponding datacenter to be regarded as active. If you specify 0.1, then 10% of the total weighted number of servers must be up.method
Determines which IP addresses to return. As with geolocation-based load balancing, you can:
return a single IP in a round-robin rotation (
single-rr
)return multiple addresses in a round-robin rotation (
method multi-rr
)return all servers that are up (
method multi-up
)return all servers, even if they are down (
method multi-all
)
option
Specify
httpchk
to monitor the health of servers.http-check
Set any relevant health check parameters.
answer-record
Enter any number of
answer-record
directives, which denote IP addresses assigned to the datacenter. -
Save your configuration, close the configuration editor, then apply your changes on the gslb line in the Services tab.
In the Setup tab, click Save under Local Configuration to persist your changes after a reboot.
Next up
DNS round-robin load-balancing