使用 cloudwatch 警报进行 AWS route53 故障转移

Posted

技术标签:

【中文标题】使用 cloudwatch 警报进行 AWS route53 故障转移【英文标题】:AWS route53 failover by using cloudwatch alarms 【发布时间】:2014-03-16 16:14:13 【问题描述】:

我正在尝试使用 cloudwatch 警报通过 AWS route53 healthcheck 实现故障转移

我添加了以下主要和次要 A 记录(记录集)

Name = www.example.com (Primary and secondary has same name)
Type = A- Records (Primary and secondary has same name)
TTL = 60Sec (Primary and secondary has same name, recommended by AWS)
Value = IP of primary and secondary servers
Routing policy = Failover
Failover Record Type = Select Primary for Primary/ Select Secondary for secondary
Health Check to Associate = I have only associate health check with Primary A-ecord(recordset)

健康检查设置

IP = Ip address 
Host name = www2 
URL = /abc/
Protocol = HTTP 
String = abc

CloudWatch 警报设置

Whenever = Maximum of Health Check Status 
IS <= 0 
For at Least = 2 
Consecutive period of = 5 minutes 

默认情况下,AWS 需要 3 分钟进行故障转移,但我已配置上述警报设置,因此需要 10 分钟进行故障转移,但仍会在 3 分钟前转移到辅助站点。

以下是aws文档

AWS dns-failover

Monitoring Health Checks Using CloudWatch

谢谢 穆达萨

【问题讨论】:

【参考方案1】:

我在 AWS 表单上提出了同样的问题,以下是答案。

As far as I know, the alarms can not be used to control Route 53 failover. The health check interval, number of failures required to trigger failover, and all that is currently not configurable. You could probably use a higher TTL for the primary record to delay the failover for some users, though. 

DNS failover based on CloudWatch Metrics

【讨论】:

以上是关于使用 cloudwatch 警报进行 AWS route53 故障转移的主要内容,如果未能解决你的问题,请参考以下文章

我可以使用 CloudWatch 警报扩展 AWS Spot 实例吗?

Terraform AWS Cloudwatch 警报

来自账户 A 的 AWS Cloudwatch 警报无法发布到账户 B 中的 SNS 主题

如何禁用AWS Cloudwatch指标

将现有 AWS CloudWatch 警报导出到 CloudFormation 模板

是否可以确定在 cloudwatch aws 上发送警报的时间?