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 records. 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 records 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 Records

If you add health checks to all of the records in a group of weighted records, and you assign nonzero weights to all of the records, 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 record:

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

  2. Amazon Route 53 checks the current status of the health check that you associated with that record. (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 record, such as an IP address.

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

If you add health checks to all of the records in a group of weighted records, but you give nonzero weights to some records 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 records. For more information, see Configuring Active-Passive Failover by Using Amazon Route 53 Failover and Failover Alias Records.) Health checks in this configuration work the same as in the active-active configuration—when all records have nonzero weights—with the following exceptions:

  • Amazon Route 53 initially considers only the nonzero weighted records, if any.

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

If a record in a group of weighted records 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 records in the group of weighted records are healthy, Amazon Route 53 needs to return something in response to DNS queries, but it has no basis for choosing one record over another. In this circumstance, Amazon Route 53 considers all of the records in the group to be healthy and selects one based on their assigned weights, omitting the records that have a weight of 0.

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

For more information about weighted records, see Weighted Routing.

Configuring Active-Active Failover by Using Amazon Route 53 Latency and Latency Alias Records

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

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

  1. Amazon Route 53 selects a latency record 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 record. (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 record, for example, an IP address.

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

If a record in a group of latency records 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 records in a latency record are healthy, Amazon Route 53 needs to return something in response to DNS queries, but it has no basis for choosing one record over another. In this circumstance, Amazon Route 53 considers all of these records healthy and selects a record based on the latency between the user and each region.

You can also use latency alias records to configure active-active failover. Assuming that you set Evaluate Target Health to true for all of your latency alias records, the health of a latency alias record depends on the health of the alias target or targets. For example, suppose the alias target for a latency alias record is a group of weighted records that all have nonzero weights. As long as at least one of the weighted records is healthy, Amazon Route 53 considers the latency alias record to be healthy. If none of the weighted records is healthy, Amazon Route 53 considers the latency alias record to be unhealthy. Amazon Route 53 stops considering records for that region (in that branch of the tree) until at least one weighted record 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 records, see Latency-based Routing.

Configuring Active-Passive Failover by Using Amazon Route 53 Failover and Failover Alias Records

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

For example, you might create a pair of failover records 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 records. If you associate health checks with both the primary and secondary failover records, here's how Amazon Route 53 responds to requests:

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

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

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

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

Use failover records 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 record, and you specify the server in the US West (N. California) region in the secondary failover record.

Use failover alias records when you have two groups of records (for example, groups of weighted or latency records), 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 record and a failover alias record. Either record, the primary or the secondary, can be the failover alias record. For example, you might create a failover record for a single HTTP server, and create a failover alias record 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 records 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.