Question

I have some questions about Auto Scaling in Amazon EC2.

  • I run deployment in my application several times a day from GitHub and I need compile the Asset Pipeline to send static data to Amazon S3. How do I replicate my application (updated) to others actives servers?
  • And for new servers started by Auto Scaling?

I hope they can help me, thanks!

Was it helpful?

Solution

Try using configuration management tools like Chef or Puppet.

I am not sure if any out of the box solution is available for AWS Auto scaling instances. But byy making use of the instance user-data and chef it is possible to replicate the updated deployments.

OTHER TIPS

I am assuming you have a launch config determined for the application. The way we do it is to create a new AMI with the new codebase. Then update the launch config to reflect the new AMI.

When we are ready to start the update, we simply terminate instances in teh load balancer and let the launch config start up new instances of the new AMI's.

So for example, say your launch config state that you have a minimum of 8 instances and a max of 12 instances. And say you are currently running at 10 instances. We would terminate (or just remove from load balancer) a number of instances to get below the min instances (say 4 instances). THis would then start up two new instances to meet the min launch config. Once these are successfully in the load balancer, we would terminate perhaps 4 more instances, and let 4 new ones launch. Then finally terminate the final two instances.

This allow for a staged rollout of new AMI's into the production environment while minimizing the load impact on the serer cluster. Of course if you have a case where you need to update DB schema or something like that to where you need a hard downtime for the cutover, this would vary slightly in that you would need to change your launch configuration, terminate your all your instances, make the DB migration, then start up new instances

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top