これらの手順を使用して自動スケーリングを設定しました...
$ elb-create-lb autoscalelb --headers --listener "lb-port = 80、instance-port = 80、protocol = http" --listener "lb-port = 443、instance-port = 443、protocol = tcp" --availability-zones 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 LOAD-BALANCERS MIN-SIZE MAX-SIZE DESIRED-CAPACITY AUTO-SCALING-GROUP autoscleasg autoscalelc us-east-1d
autoscalelb 1 5 1 INSTANCE INSTANCE-ID AVAILABILITY-ZONE STATEステータス起動-CONFIGINSTANCEi-acf48bd5 us-east-1d InService Healthy autoscalelc
その後:
$ elb-describe-instance-health autoscalelb --headers
それが示している:
INSTANCE_IDINSTANCE_ID状態説明
理由コードINSTANCE_IDi-ee364697InService N / A
N / A INSTANCE_IDi-acf48bd5OutOfServiceインスタンスが少なくともUnhealthyThreshold数のヘルスチェックに連続して失敗しました。実例
私の最初の問題は:
メインインスタンスに負荷がない場合、自動的に1つの追加インスタンスが作成されます。
次に、新しく作成されたインスタンスは常にOutOfServiceです。
次のコマンドを使用して最小サイズを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%に達し、インスタンスは作成されていません。
私を助けてください...