Menu
Amazon Route 53
Developer Guide (API Version 2013-04-01)

Options for Configuring Amazon Route 53 Active-Active and Active-Passive Failover

You can configure Amazon Route 53 failover in a variety of ways by using different combinations of Amazon Route 53 resource record sets. The following sections give a brief overview of how you can configure simple active-active and active-passive failover. You can also create more complex configurations by combining types of resource record sets in a larger tree. For more information, see How Health Checks Work in Complex Amazon Route 53 Configurations.

Configuring Active-Active or Active-Passive Failover by Using Amazon Route 53 Weighted and Weighted Alias Resource Record Sets

If you add health checks to all of the resource record sets in a group of weighted resource record sets, and you assign nonzero weights to all of the resource record sets, the Amazon Route 53 behavior results in an active-active failover configuration. Any resource can be returned at any time in response to a DNS query unless it's unhealthy.

Here's how Amazon Route 53 chooses a healthy resource record set:

  1. Amazon Route 53 selects a weighted resource record set based on the weights that you've assigned to the resource record sets that have the same name and type.

  2. Amazon Route 53 checks the current status of the health check that you associated with that resource record set. (Amazon Route 53 periodically checks the health of the endpoint that is specified in a health check; it doesn't perform the health check when the DNS query arrives.)

  3. If the health check endpoint is healthy, Amazon Route 53 responds to the query with the applicable value from the resource record set, such as an IP address.

    If the health check endpoint is not healthy, Amazon Route 53 selects another weighted resource record set and repeats the process until it finds a resource record set for which the health check endpoint is healthy.

If you add health checks to all of the resource record sets in a group of weighted resource record sets, but you give nonzero weights to some resource record sets and zero weights to others, the Amazon Route 53 behavior results in an active-passive failover configuration. (If you want an active-passive failover configuration, we recommend that you use failover resource record sets. For more information, see Configuring Active-Passive Failover by Using Amazon Route 53 Failover and Failover Alias Resource Record Sets.) Health checks in this configuration work the same as in the active-active configuration—when all resource record sets have nonzero weights—with the following exceptions:

  • Amazon Route 53 initially considers only the nonzero weighted resource record sets, if any.

  • If all of the resource record sets that have a weight greater than 0 are unhealthy, then Amazon Route 53 considers the zero-weighted resource record sets.

If a resource record set in a group of weighted resource record sets doesn't have an associated health check, Amazon Route 53 always considers it healthy and always includes it among possible responses to a query.

If none of the resource record sets in the group of weighted resource record sets are healthy, Amazon Route 53 needs to return something in response to DNS queries, but it has no basis for choosing one resource record set over another. In this circumstance, Amazon Route 53 considers all of the resource record sets in the group to be healthy and selects one based on their assigned weights, omitting the resource record sets that have a weight of 0.

You can also use weighted alias resource record sets to configure active-active or active-passive failover. Weighting works the same way as with weighted resource record sets, but the health of a weighted alias resource record set depends on the health of the alias target or targets. For example, suppose the alias target for a weighted alias resource record set is a group of weighted resource record sets that all have nonzero weights. As long as at least one of the weighted resource record sets is healthy, Amazon Route 53 considers the weighted alias resource record set to be healthy. If none of the weighted resource record sets is healthy, Amazon Route 53 considers the weighted alias resource record set to be unhealthy. Amazon Route 53 stops considering resource record sets in that branch of the tree until at least one weighted resource record set becomes healthy again.

For more information about weighted resource record sets, see Weighted Routing.

Configuring Active-Active Failover by Using Amazon Route 53 Latency and Latency Alias Resource Record Sets

If you add health checks to all of the resource record sets in a group of latency resource record sets, the Amazon Route 53 behavior results in an active-active failover configuration.

Amazon Route 53 considers the health and the latency of the resource record sets when choosing the resource record set with which to respond to DNS queries:

  1. Amazon Route 53 selects a latency resource record set based on the latency between your users and the Amazon EC2 regions in which you have resources.

  2. Amazon Route 53 checks the current status of the health check that you associated with that resource record set. (Amazon Route 53 periodically checks the health of the endpoint that is specified in a health check; it doesn't perform the health check when the DNS query arrives.)

  3. If the health check endpoint is healthy, Amazon Route 53 responds to the query with the applicable value from the resource record set, for example, an IP address.

    If the health check endpoint is not healthy, Amazon Route 53 selects the latency resource record set with the next-best latency and repeats the process until it finds a resource record set for which the health check endpoint is healthy.

If a resource record set in a group of latency resource record sets doesn't have a health check, Amazon Route 53 always considers it healthy and always includes it among possible responses to a query.

If none of the resource record sets in a latency resource record set are healthy, Amazon Route 53 needs to return something in response to DNS queries, but it has no basis for choosing one resource record set over another. In this circumstance, Amazon Route 53 considers all of these resource record sets healthy and selects a resource record set based on the latency between the user and each region.

You can also use latency alias resource record sets to configure active-active failover. Assuming that you set Evaluate Target Health to true for all of your latency alias resource record sets, the health of a latency alias resource record set depends on the health of the alias target or targets. For example, suppose the alias target for a latency alias resource record set is a group of weighted resource record sets that all have nonzero weights. As long as at least one of the weighted resource record sets is healthy, Amazon Route 53 considers the latency alias resource record set to be healthy. If none of the weighted resource record sets is healthy, Amazon Route 53 considers the latency alias resource record set to be unhealthy. Amazon Route 53 stops considering resource record sets for that region (in that branch of the tree) until at least one weighted resource record set becomes healthy again. For a more detailed explanation of this configuration, see How Health Checks Work in Complex Amazon Route 53 Configurations.

For more information about latency resource record sets, see Latency-based Routing.

Configuring Active-Passive Failover by Using Amazon Route 53 Failover and Failover Alias Resource Record Sets

You can create an active-passive failover configuration by using failover resource record sets. You create a primary and a secondary failover resource record set that have the same name and type, and you associate a health check with each. The primary and secondary failover resource record sets can refer to anything from an Amazon S3 bucket that is configured as a website to a complex tree of resource record sets. When all of the resources that are referenced by the primary failover resource record set are unhealthy, Amazon Route 53 automatically begins responding to queries by using the resources that are referenced by the secondary failover resource record set.

For example, you might create a pair of failover resource record sets for example.com. After the configuration is complete, Amazon Route 53 responds to queries for example.com based on the health of the endpoints that you associated with the primary and secondary resource record sets. If you associate health checks with both the primary and secondary failover resource record sets, here's how Amazon Route 53 responds to requests:

  • If Amazon Route 53 considers the primary resource record set healthy (if the health check endpoint is healthy), Amazon Route 53 returns only the primary resource record set in response to a DNS query.

  • If Amazon Route 53 considers the primary resource record set unhealthy and the secondary resource record set healthy, Amazon Route 53 returns the secondary resource record set instead.

  • If Amazon Route 53 considers both the primary and secondary resource record sets unhealthy, Amazon Route 53 returns the primary resource record set.

When you're configuring the secondary resource record set, adding a health check is optional. If you omit the health check for the secondary resource record set, and if the health check endpoint for the primary resource record set is unhealthy, Amazon Route 53 always responds to DNS queries by using the secondary resource record set. This is true even if the secondary is unhealthy. When there is no health check on the secondary resource record set, Amazon Route 53 doesn't know that the associated resource is unhealthy and always assumes that it's healthy.

Use failover resource record sets when you have two resources and you want one of the resources to handle all requests whenever it's available. For example, you might have two HTTP servers running on Amazon EC2 servers in different regions, and you want Amazon Route 53 to respond to queries with the IP address of the HTTP server in the US West (Oregon) region whenever that server is available. You specify that server in the primary failover resource record set, and you specify the server in the US West (N. California) region in the secondary failover resource record set.

Use failover alias resource record sets when you have two groups of resource record sets (for example, groups of weighted or latency resource record sets), and you want Amazon Route 53 to respond to queries using resources in the primary group as long as at least one of those resources is available. If health checks for all of the resources in the primary group are failing, Amazon Route 53 will begin to respond to queries using resources in the secondary group.

You can also combine a failover resource record set and a failover alias resource record set. Either resource record set, the primary or the secondary, can be the failover alias resource record set. For example, you might create a failover resource record set for a single HTTP server, and create a failover alias resource record set for an Amazon S3 bucket that is configured as a website; in this configuration, the Amazon S3 bucket might only display a message saying that your website is unavailable.

You can create failover and failover alias resource record sets using the Amazon Route 53 console or the Amazon Route 53 API. For information about using the console, see Creating Resource Record Sets by Using the Amazon Route 53 Console. For information about using the Amazon Route 53 API, see ChangeResourceRecordSets in the Amazon Route 53 API Reference.