Having a failover group can help you prevent unwanted downtime should your primary stack become unresponsive, for anything from hardware to networking issues. Follow this guide to setup your failover stack, and how to use it if necessary.
This is a complex procedure, and we recommend that you test it in a staging environment to reduce any potential downtime.
Setup the failover group
As with any migration, you will need to deal with moving your code, data and traffic.
Clone your existing stack to a different cloud vendor or data center, and set it into maintenance mode to prevent it from serving content. We highly recommend that you build a stack with similar server specifications to your main stack to avoid issues during a switch.
Enable database replication between your stacks - this will setup a master/slave architecture between your stacks, whereby the slave is an exact replica of the master at all times.
Use Failover Groups to make it easy for you to switch between stacks. By pointing your domain at the Failover address, you will be able to switch your traffic between stacks at the click of a button.
How to use the failover stack
If and when your main stack fails, you will need to switch to the failover stack.
- Set your main stack into maintenance mode, to prevent new data being written to it.
- Turn off the database replication.
- Make your database slave a master - this will allow data to be written to the database.
- Turn off maintenance mode on your failover stack.
- Use your Failover group menu to switch your traffic to the failover stack. The TTL on the Failover address is 5 minutes, so you should see your users on the new stack momentarily.