简体   繁体   English

如何在Amazon Auto-scaling组中的多个ec2实例上部署和更新应用程序?

[英]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? 您能否建议我在哪些方面将代码更改从SVN部署到在自动扩展组中的Amazon负载均衡器后面运行的所有ec2实例? I also need to update code to latest version when a new ec2 instance launching automatically in auto-scaling group. 当在自动缩放组中自动启动新的ec2实例时,我还需要将代码更新到最新版本。

I suppose to use 'user-data' to run 'svn up' on new machines. 我想使用'user-data'在新机器上运行'svn up'。 And probably I could use cron to run 'svn up' periodically on all machines. 也许我可以使用cron在所有机器上定期运行'svn up'。 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. 在我看来,你不应该更新正在运行的实例上的代码,更好的是创建一个主AMI,它已准备好所有更新的堆栈/代码,然后有条不紊地终止正在运行的实例,并让自动扩展代码来处理部署根据需要的新实例,这将实际部署您的新代码。

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/ 您可以使用AWS Cloudformation执行此任务: http ://aws.amazon.com/about-aws/whats-new/2013/02/20/announcing-new-aws-cloudformation-deployment-enhancements/

or ElasticBeanStalk: 或者ElasticBeanStalk:

http://aws.amazon.com/about-aws/whats-new/2013/11/11/aws-elastic-beanstalk-announces-rolling-updates/ 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. 尝试谷歌搜索“AWS滚动更新”以获得更有用的链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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