Failover
Scenario
Section titled “Scenario”Let’s say we have two web servers, www1 and www2. They are both supposed to host www.example.com. www1 is the primary server; as long as it is up, it should be the one to serve traffic. But if it goes down, traffic should be shifted over to www2, the secondary.
How-To
Section titled “How-To”- Create a Plain Resource Record
- Add two pool members, one for
www1and another forwww2. Use a Conditional Function Kind- For the “Condition”, choose a TCP Connection Check or an HTTP Check. Configure it to perform a suitable health check against your server. In the above example, the HTTP Checks would have the URLs
https://www1.example.comandhttps://www2.example.com - For the “If True” and “If False” parts of the Conditional, choose a Constant Function Kind
- “If True” is
192.0.2.1, the primary’s address - “If False” is
198.51.100.1, the secondary’s address1
- “If True” is
- For the “Condition”, choose a TCP Connection Check or an HTTP Check. Configure it to perform a suitable health check against your server. In the above example, the HTTP Checks would have the URLs
Footnotes
Section titled “Footnotes”-
If you want more than two servers in your failover chain (i.e. more than just a primary and a secondary), you can replace the “If False” constant with another Conditional. That Conditional can then health check the secondary server and fail over to a tertiary server. And so on… ↩