Question

I am looking for an easy way to fail over to a different DC quickly, does CloudFlare offer anything special in this regards with things like health checks or is it just like a standard DNS service?

Was it helpful?

Solution 2

We don't have automatic failover at this time (something we're looking at). We can support the additional DNS entries in your zone file, of course, but you would currently have to manually make the change in that circumstance.

OTHER TIPS

Update: CloudFlare started a closed beta for the Traffic Manager feature which allows to do exactly this kind of failover:

https://www.cloudflare.com/traffic-manager/


AWS Failover:

The following solution seems to work well when you are hosting your backend system on AWS:

  1. I setup a AWS Route 53 zone with a separate domain (e.g. failover-example.com). Route 53 allows you to setup health checks on the backend server (e.g. the load balancer) with DNS failover. AWS will remove the unhealthy backend system from the DNS record list.
  2. In cloudflare I setup a CNAME for example.com record to failover-example.com and activate the cloudflare proxy on example.com.

The result is that the browser resolves the IP address of example.com to a cloudflare IP address. Cloudflare queries the AWS DNS server to lockup failover-example.com. Cloudflare fetches the content from the resolved IP address and returns the content back to the browser.

In my tests the switch to the other backend system occurs after ca. 20 seconds.

The separate domain is required because cloudflare does not route the traffic through the proxy when the CNAME is a subdomain of example.com.

I have tried to visualize the failover. In theory the failover works with any DNS failover capable service and not only with Route53:

enter image description here

The browser connects always with CloudFlare and hence a DNS failover of the backend system does never effect the browser of the user.

To add -- in the mean time, I'd recommend looking at https://runbook.io

Several other DIY options:

You'd want to decide if these are the right options for you, of course.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top