gpt4 book ai didi

amazon-web-services - 在AWS中按比例缩小Auto Scaling组会导致永久警报

转载 作者:行者123 更新时间:2023-12-04 07:34:56 24 4
gpt4 key购买 nike

我目前正在使用两个扩展策略,这些策略已附加到我的自动扩展组中:
一种

  • 调用CloudWatch警报时将调用的扩展策略。此CloudWatch警报使用CPUUtilization指标,并在超过80%的CPU上触发。
  • 另一个是按比例缩小策略,该策略在调用其他CloudWatch警报时被调用。此CloudWatch警报使用CPUUtilization指标,并在CPU低于50%时触发。

  • 这种方法的副作用是,当我的ASG实例处于空闲状态(完全按比例缩小,没有处理发生)时,我的ASG处于警报状态。

    有没有办法对此进行不同的设置,以使我的ASG不会处于持续发出警报的状态?

    以下是来自CloudFormation模板的这些警报的一部分:
    "ScaleUpPolicy" : {
    "Type" : "AWS::AutoScaling::ScalingPolicy",
    "Properties" : {
    "AdjustmentType" : "ChangeInCapacity",
    "AutoScalingGroupName" : { "Ref" : "WebApplicationASG" },
    "Cooldown" : "1",
    "ScalingAdjustment" : "1"
    }
    },
    "CPUAlarmHigh": {
    "Type": "AWS::CloudWatch::Alarm",
    "Properties": {
    "EvaluationPeriods": "1",
    "Statistic": "Average",
    "Threshold": "80",
    "AlarmDescription": "Alarm if CPU too high or metric disappears indicating instance is down",
    "Period": "60",
    "AlarmActions": [ { "Ref": "ScaleUpPolicy" } ],
    "Namespace": "AWS/EC2",
    "Dimensions": [ {
    "Name": "AutoScalingGroupName",
    "Value": { "Ref": "WebApplicationASG" }
    } ],
    "ComparisonOperator": "GreaterThanThreshold",
    "MetricName": "CPUUtilization"
    }
    },
    "ScaleDownPolicy" : {
    "Type" : "AWS::AutoScaling::ScalingPolicy",
    "Properties" : {
    "AdjustmentType" : "ChangeInCapacity",
    "AutoScalingGroupName" : { "Ref" : "WebApplicationASG" },
    "Cooldown" : "1",
    "ScalingAdjustment" : "-1"
    }
    },
    "CPUAlarmLow": {
    "Type": "AWS::CloudWatch::Alarm",
    "Properties": {
    "EvaluationPeriods": "1",
    "Statistic": "Average",
    "Threshold": "50",
    "AlarmDescription": "Alarm if CPU is low, causing scale down",
    "Period": "60",
    "AlarmActions": [ { "Ref": "ScaleDownPolicy" } ],
    "Namespace": "AWS/EC2",
    "Dimensions": [ {
    "Name": "AutoScalingGroupName",
    "Value": { "Ref": "WebApplicationASG" }
    } ],
    "ComparisonOperator": "LessThanThreshold",
    "MetricName": "CPUUtilization"
    }
    },

    最佳答案

    这是正常的和预期的行为。

    将指标设置为警报状态不是问题-请记住,触发事件的警报状态的变化是。因此,大概在您的按比例放大触发器触发警报时,按比例缩小便会退出警报状态。然后,当指标下降时,它将返回到警报状态,并触发缩减事件。

    关于amazon-web-services - 在AWS中按比例缩小Auto Scaling组会导致永久警报,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35526743/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com