【问题标题】:ECS Auto Scaling - Unable to scale out on CPU Reservation metricECS Auto Scaling - 无法按 CPU 预留指标横向扩展
【发布时间】:2019-02-13 06:13:43
【问题描述】:

我有以下 Auto Scaling 策略,它应该在 CPU 预留超过 75% 时添加实例。我没有看到任何为此设置触发的警报

Policy type:
Simple scaling
Execute policy when:
ECS-CPUHighAlarm
breaches the alarm threshold: CPUReservation > 75 for 5 consecutive periods 
of 60 seconds for the metric dimensions AutoScalingGroupName = ECS-
ECSAutoScalingGroup
Take the action:
Add 1 instances And then wait: 600 seconds before allowing another scaling 
activity

以下是 CloudFormation 脚本。

CPUHighAlarm:
Type: 'AWS::CloudWatch::Alarm'
Properties:
  EvaluationPeriods: 5
  Statistic: Average
  Threshold: 75
  AlarmDescription: 'Alarm if CPU reservation is high.'
  Period: 60
  AlarmActions:
  - !Ref 'CPUScalingUpPolicy'
  Namespace: 'AWS/ECS'
  Dimensions:
  - Name: AutoScalingGroupName
    Value: !Ref 'ECSAutoScalingGroup'
  ComparisonOperator: GreaterThanThreshold
  MetricName: CPUReservation

但根据我在下面给出的图表中观察到的情况,它并没有发生。 CPU Reservation Chart

对我缺少配置的地方有什么想法吗?

【问题讨论】:

  • 是无法横向扩展还是没有触发警报?
  • 没有触发警报也没有横向扩展
  • 能否在 AutoScalingGroup 属性模板上显示 MetricsCollection 值?
  • 目前没有在模板中指定 MetricsCollection。它是否默认发送所有指标?

标签: autoscaling aws-ecs


【解决方案1】:

我想我找到了问题所在。它位于 CloudFormation 模板中。当使用命名空间作为 AWS/ECS 以下是有效维度时,

Dimensions:
- Name: ClusterName
  Value: !Ref 'ECSClusterName'

因此,警报无效并被卡在 INSUFFICIENT_DATA 中,我在阅读本文后才意识到,

https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ecs-metricscollected.html

我运行了测试,警报被触发并自动缩放。

【讨论】:

  • 你为什么不把它标记为答案呢?它对我有用:)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-12-09
  • 2017-07-05
  • 2012-02-03
  • 1970-01-01
  • 2012-04-14
  • 2021-09-01
  • 1970-01-01
相关资源
最近更新 更多