简体   繁体   中英

How to deploy and update app on multiply ec2 instances in Amazon Auto-scaling group?

Could you suggest in which ways I can deploy code changes from SVN to all ec2 instances running behind Amazon load balancer in auto-scaling group? I also need to update code to latest version when a new ec2 instance launching automatically in auto-scaling group.

I suppose to use 'user-data' to run 'svn up' on new machines. And probably I could use cron to run 'svn up' periodically on all machines. Could you suggest better solutions?

In my opinion, you shouldn't be updating code on the running instances, better to create an master AMI that has all the updated stack/code ready to go and then methodically terminate the running instances and let the auto scaling code to care of deploying new instances as needed, which will in effect deploy your new code.

You can use AWS Cloudformation for this task: http://aws.amazon.com/about-aws/whats-new/2013/02/20/announcing-new-aws-cloudformation-deployment-enhancements/

or ElasticBeanStalk:

http://aws.amazon.com/about-aws/whats-new/2013/11/11/aws-elastic-beanstalk-announces-rolling-updates/

Try googling "AWS Rolling Updates" for even more helpful links.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM