Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services AWS自动校准组健康检查类型:ELB或EC2?_Amazon Web Services_Amazon Ec2_Aws Sdk_Autoscaling - Fatal编程技术网

Amazon web services AWS自动校准组健康检查类型:ELB或EC2?

Amazon web services AWS自动校准组健康检查类型:ELB或EC2?,amazon-web-services,amazon-ec2,aws-sdk,autoscaling,Amazon Web Services,Amazon Ec2,Aws Sdk,Autoscaling,我正在创建一个面向internet的经典负载平衡器(CLB),配置如下 Connection Draining:Enabled, 300 seconds health check configuration Ping Target TCP:22 Timeout 5 seconds Interval 30 seconds Unhealthy threshold 2 Healthy threshold 10 并将此CLB与具有以下配置的自动缩放组(ASG)连接 Desired: 2

我正在创建一个面向internet的经典负载平衡器(CLB),配置如下

Connection Draining:Enabled, 300 seconds

health check configuration 
Ping Target 
TCP:22
Timeout 5 seconds
Interval    30 seconds
Unhealthy threshold 2
Healthy threshold   10
并将此CLB与具有以下配置的自动缩放组(ASG)连接

Desired: 2
Availability Zone(s) : us-east-1a, us-east-1c
Min:2
Subnet(s) : subnet-0ab1df27,subnet-5dc8af06
Max: 20
Health Check Type: ELB
Health Check Grace Period: 300
Default Cooldown:300

以下是ASG附带的扩展策略

增加实例策略 在以下情况下执行策略:aws-ec2-alarm-CPU-high-utilization
超过报警阈值:CPUUUtilization>=70,持续两个300秒的连续周期 对于公制尺寸SautoScalingGroupName=演示自动缩放组
执行操作:添加1个实例
然后等待300秒,然后再允许另一个缩放活动

减少实例策略 在以下情况下执行策略:aws-ec2-alarm-CPU-low-utilization

超出报警阈值:CPUUtilization问题在于负载平衡器的配置。更改如下:

Timeout 30 seconds
Interval 60 seconds
Unhealthy threshold 10
Healthy threshold 2

使用ELB健康检查时,自动缩放组将依赖ELB健康检查来确定实例是否健康。看起来ELB运行状况检查失败了,这导致ASG终止实例并启动一个新实例


您确定ELB运行状况检查配置正确吗?看起来您正在检查端口22。ELB需要能够访问此端口。您的安全组允许这样做吗?

您是否手动设置所需的值?否。我通过AWS SDKIn您的配置所做的一切,我看到您将所需的值设置为2。对我来说,这似乎不正确。因为所需的值用于强制ASG更改实例数,而不考虑报警。正常情况下,不应设置。是。我始终希望至少运行2个实例;来自AWS SDK的“DesiredCapacity-(Integer)应在自动缩放组中运行的EC2实例数。此数必须大于或等于组的最小大小,且小于或等于组的最大大小。”但由于ELB运行状况检查失败而终止。不是吗?让我看看这些配置没有影响。这仍然会在ELB实例状态中给出退出服务的
,并且它正在终止和创建实例。顺便问一下,60秒的间隔不是很高吗?是的。连接到ELB的安全组允许TCP 22。