x instances already in AWS load balancer, makign auto scale group starts adding more instances

StackOverflow https://stackoverflow.com/questions/19628420

Вопрос

i have 4 instances already in AWS load balancer

I want to create a policy to add a couple of servers always when one of my instances shoots the cpu beyond 75%, minimum 2 instances and maximum 8 instances.

as-create-auto-scaling-group autoscale_api_group --launch-configuration autoscale_api_config --availability-zones us-east-1d --min-size 2 --max-size 8 --load-balancers api-lb --health-check-type EC2 --grace-period 2700 --desired-capacity 4

but this command starts making 2 more instances, the moment I run the command, I mean it shouldn't i haven't even specified the policy.

Это было полезно?

Решение 2

It would still create minimum number of instances the moment you create the autoscaling group. Reason being that the autoscaling policy will create its own instances, and won't consider the instances already in the process, so one will have to get rid of the old ones and let the new ones be.

Другие советы

you need to create cloudwatch alarm for your requirement (when one of my instances shoots the cpu beyond 75%) and then configure the alarm action to call autscalling policy.

Please read this

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top