如何部署和亚马逊自动伸缩群更新乘EC2实例应用程序?亚马逊、伸缩、应用程序、实例

2023-09-11 11:06:10 作者:好听的男生微信名字:借着风拥抱你ペ

您可以建议在其中的方式我可以部署从SVN code更改运行在背后自动缩放组亚马逊负载均衡的所有EC2实例? 我还需要更新code到最新版本,当一个新的EC2实例中自动缩放组会自动启动。

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.

我想用用户数据运行在新机器上使用svn了'。而也许我可以用cron来执行svn了定期对所有机器。 你可以建议更好的解决方案?

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?

推荐答案

在我看来,你不应该更新,在运行的情况下,code,最好创建一个主AMI具有所有的更新堆栈/ $ C $ç准备去,然后有条不紊地终止正在运行的情况下,让自动缩放code照顾部署需要新的实例,这将影响部署新的code。

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.

您可以使用AWS Cloudformation此任务: http://aws.amazon.com/about-aws/whats-new/2013/02/20/announcing-new-aws-cloudformation-deployment-enhancements/

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/

或ElasticBeanStalk:

or ElasticBeanStalk:

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

尝试谷歌搜索AWS滚动更新甚至更多有用的链接。

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