Ana*_*oni 7 amazon-web-services amazon-elb aws-cloudformation autoscaling amazon-cloudwatch
我正在将AWS CloudFormation用于我的应用程序,并尝试通过相应的模板发出请求计数警报.我可以直接为Elastic Load Balancer成功发出请求计数警报,但当我尝试通过CloudFormation模板实现相同时,Amazon 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"
}
}
},
Run Code Online (Sandbox Code Playgroud)
我的警报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"
}
}
]
}
},
Run Code Online (Sandbox Code Playgroud)
从上面它产生报警,其中"数据不足"为状态.谁能告诉我可能是什么原因?如果有任何样本/示例模板可用于在ELB上使用请求计数警报,则将不胜感激.
该弹性负载均衡(ELB)您的片段报警片段亚马逊CloudFormation模板看起来不错,但你的亚马逊CloudWatch的片段包含想必不正确的尺寸,只要它引用的AutoScalingGroupName命名WebServerGroup -这不是一个支持的尺寸为每部分尺寸的弹性负载平衡度量标准页面监控负载均衡器使用CloudWatch,可以按以下任何维度聚合Elastic Load Balancing数据:
归档时间: |
|
查看次数: |
4181 次 |
最近记录: |