【发布时间】:2012-06-20 15:08:45
【问题描述】:
我已经使用这些步骤设置了自动缩放...
$ elb-create-lb autoscalelb --headers --listener "lb-port=80,instance-port=80,protocol=http" --listener “lb-port=443,instance-port=443,protocol=tcp”--可用性区域 us-east-1d
$ elb-describe-lbs autoscalelb
$ elb-register-instances-with-lb autoscalelb --instances i-ee364697
$ elb-configure-healthcheck autoscalelb --headers --target "TCP:80" --interval 5 --timeout 3 --unhealthy-threshold 2 --healthy-threshold 4
$ as-create-launch-config autoscalelc --image-id ami-baba68d3 --instance-type t1.micro
$ as-create-auto-scaling-group autoscleasg --availability-zones us-east-1d --launch-configuration autoscalelc --min-size 1 --max-size 5 --desired-capacity 1 --load-balancers autoscalelb
$ as-describe-auto-scaling-groups autoscleasg
$ as-put-scaling-policy MyScaleUpPolicy --auto-scaling-group autoscleasg --adjustment=1 --type ChangeInCapacity --cooldown 300
$ mon-put-metric-alarm MyHighCPUAlarm --comparison-operator GreaterThanThreshold --evaluation-periods 1 --metric-name CPUUtilization --namespace "AWS/EC2" --period 600 --statistic Average --threshold 80 --alarm-actions arn:aws:autoscaling:us-east-1:616259365041:scalingPolicy:46c2d3b3-7f29-42b6-ab64-548f45de334f:autoScalingGroupName/autoscleasg:policyName/MyScaleUpPolicy --dimensions "AutoScalingGroupName=autoscleasg"
$ as-put-scaling-policy MyScaleDownPolicy --auto-scaling-group autoscleasg --adjustment=-1 --type ChangeInCapacity --cooldown 300
$ mon-put-metric-alarm MyLowCPUAlarm --comparison-operator LessThanThreshold --evaluation-periods 1 --metric-name CPUUtilization --namespace "AWS/EC2" --period 600 --statistic Average --threshold 50 --alarm-actions arn:aws:autoscaling:us-east-1:616259365041:scalingPolicy:30ccd42c-06fe-401a-8b8f-a4e49bbb9c7d :autoScalingGroupName/autoscleasg:policyName/MyScaleDownPolicy --dimensions "AutoScalingGroupName=autoscleasg"
在这之后我运行这个命令:
$ as-describe-auto-scaling-groups autoscleasg --headers
回复:
AUTO-SCALING-GROUP GROUP-NAME LAUNCH-CONFIG AVAILABILITY-ZONES 负载平衡器 最小尺寸 最大尺寸 所需容量 AUTO-SCALING-GROUP autoscleasg autoscalelc us-east-1d
autoscalelb 1 5 1 实例实例 ID 可用性-区域状态状态启动-配置实例 i-acf48bd5 us-east-1d InService 健康 autoscalelc
然后:
$ elb-describe-instance-health autoscalelb --headers
它显示:
INSTANCE_ID INSTANCE_ID 状态描述
原因代码 INSTANCE_ID i-ee364697 InService N/A
N/A INSTANCE_ID i-acf48bd5 OutOfService 实例在 至少连续健康检查的 UnhealthyThreshold 次数。 实例
我的第一个问题是:
当主实例没有负载时,它会自动创建一个额外的实例。
其次, 新创建的实例总是 OutOfService。
如果我使用以下命令将 Min Size 更改为 0:
$ as-update-auto-scaling-group autoscleasg --launch-configuration autoscalelc --availability-zones us-east-1d --min-size 0 --max-size 5
并尝试使用 xen 加载实例:
自动缩放不创建任何实例。即使我在最多 5 个会话上运行上述命令,CPU 利用率达到 100%,但仍然没有创建实例。
请帮帮我...
【问题讨论】:
标签: amazon-ec2 amazon load-balancing autoscaling