7
我正在爲我的應用程序使用AWS CloudFormation,並試圖通過各自的模板發出請求計數警報。我可以成功地對Elastic Load Balancer直接發出請求計數警報,但是當我嘗試通過CloudFormation模板實現相同時,Amazon CloudWatch內的警報狀態爲「數據不足」。爲什麼通過CloudFormation創建的CloudWatch請求計數警報產生「數據不足」?
我ELB JSON是:
"ElasticLoadBalancer": {
"Type": "AWS::ElasticLoadBalancing::LoadBalancer",
"Properties": {
"AvailabilityZones": {
"Fn::GetAZs": ""
},
"Listeners": [
{
"LoadBalancerPort": "80",
"InstancePort": {
"Ref": "WebServerPort"
},
"Protocol": "HTTP"
}
],
"HealthCheck": {
"Target": {
"Fn::Join": [
"",
[
"HTTP:",
{
"Ref": "WebServerPort"
},
"/"
]
]
},
"HealthyThreshold": "3",
"UnhealthyThreshold": "5",
"Interval": "30",
"Timeout": "5"
}
}
},
我的報警JSON是:
"StatisticAlarmLow": {
"Type": "AWS::CloudWatch::Alarm",
"Properties": {
"AlarmDescription": "Alarm if there are too many unhealthy hosts.",
"MetricName": "RequestCount",
"Namespace": "AWS/ELB",
"Statistic": "Sum",
"Period": "60",
"EvaluationPeriods": "2",
"ComparisonOperator": "LessThanThreshold",
"Threshold": "1500",
"AlarmActions": [
{
"Ref": "WebServerScaleUpPolicy"
}
],
"Unit": "Count",
"Dimensions": [
{
"Name": "AutoScalingGroupName",
"Value": {
"Ref": "WebServerGroup"
}
}
]
}
},
"StatisticAlarmHigh": {
"Type": "AWS::CloudWatch::Alarm",
"Properties": {
"AlarmDescription": "Alarm if there are too many unhealthy hosts.",
"MetricName": "RequestCount",
"Namespace": "AWS/ELB",
"Statistic": "Sum",
"Period": "60",
"EvaluationPeriods": "2",
"ComparisonOperator": "GreaterThanThreshold",
"Threshold": "4000",
"AlarmActions": [
{
"Ref": "WebServerScaleUpPolicy"
}
],
"Unit": "Count",
"Dimensions": [
{
"Name": "AutoScalingGroupName",
"Value": {
"Ref": "WebServerGroup"
}
}
]
}
},
從上面產生具有 「數據不足」 作爲狀態的報警。有誰可以告訴我可能是什麼原因?如果在ELB上有任何示例/示例模板可用於請求計數報警,我們將不勝感激。
謝謝Steffen Opel。我已經改變了尺寸,它的工作原理。 – 2012-04-09 05:06:02