What is a failover group?

A failover group is a managed quick response DNS address that automatically follows your stack web endpoints. You can connect it to up to 2 stacks at any time - a primary and backup stack. Should you need to switch traffic between your stacks, simply flip the switch and your traffic will flow to the backup stack within 5 minutes.

There are two major use cases for this:

Failover groups follows the web head of your stack. In other words, it points to your web server when you don’t have a load balancer, and if you have one, at your load balancer. Failover groups will also automatically update to point at a newly added load balancer. Similarly, it also gets automatically updated when you rename your stack or web servers.

A great way to test this is to use the dig command in your terminal, for example dig 414-262-781.cloud66.net, which allows you to see where the DNS is pointing.

Add a failover group

To view your failover groups, click the Failover Groups link on your Dashboard page. To add a new failover group, click the + button:

You are then be able to select a Primary and a Backup stack for your failover group. Once you have a failover group, add a CNAME record in your DNS provider dashboard that points at the address provided.

Notes

Environment variables

There is an environment variable called FAILOVER_STATUS with three different values: online, offline and none which means the traffic goes to this stack, does not go to this stack or this stack is not part of any failover groups, respectively.

You may have some jobs configured on both like sending an email, but you need them to be run only on the online one you can use this environment variable to prevent duplication.