Monday, November 17, 2014

AutoScaling: how to deploy code using autoscaling

Environment:
    Autoscaling limit: 3
  • Release your code by taking the reference of some AMI.
  • Post deployment, cut an AMI and create new Launch Configuration(e.g. product-141117).
  • Take a snapshot of already running Instance.
  • Change the launch configuration of particular Autoscaling Group by updating the AMI id.
  • Now 'scale up' instance limit in "AutoScaling Group" from 3 to 6.
  • De-select the old instances(3) from ELB.
  • Test website.
  • Scale down autoscaling group from 6 to 3.
  • remove old launch configuration.

Note: Here point 8) is tricky one, how does Autoscaling know which EC2 instance to terminate?
   - Actually AutoScaling is built in such a way that when one scales it down, the system terminates the EC2 instance by "oldest-first" rule. That means the old EC2 instances get terminated.

1 comment:

  1. Thanks for providing valuable information "how to deploy code using autoscaling". AWS auto scaling monitors your applications and automatically adjusts capacity to maintain steady.

    ReplyDelete