gpt4 book ai didi

deployment - 如何防止在 AWS Elastic Beanstalk 部署新版本应用程序期间停机?

转载 作者:行者123 更新时间:2023-12-03 10:02:30 25 4
gpt4 key购买 nike

我对Elastic Beanstalk的理解是当您部署应用程序的新版本时,它会将其部署到 Amazon EC2一次一个实例(如果您有多个)。但是,即使至少有两个实例,当我上传新的 .war 时,我的应用程序也会产生短暂的停机时间。当它部署它时,就好像它同时更新它们一样。有没有一种方法可以确保没有停机时间,并且在下一个实例开始之前完全更新并接受请求:这是事件的外观。请注意,这是应用程序的零负载,因此生产流量只会变得更糟。

INFO
Environment update completed successfully.

INFO
New application version was deployed to running EC2 instances.

ERROR
The application did not respond at the health check URL.

INFO
Waiting for 8 seconds while EC2 instances download the updated application version.

INFO
Deploying version SomethingMore to 2 instance(s).

最佳答案

实现这一目标在Elastic Beanstalk ,您需要扩展您的部署过程以促进多个环境(请参阅 AWS Elastic Beanstalk Components ):

An environment is a version that is deployed onto AWS resources. Each environment runs only a single version, however you can run the same version or different versions in many environments at the same time. [...] For more information about the environment and the resources that are created, see Architectural Overview. [emphasis mine]



此功能对于测试/调试单独的版本很有用,但特别是这也支持环境的热交换,请参阅 Deploying Versions With Zero Downtime对于相应的演练:

Since AWS Elastic Beanstalk performs an in-place update when you update your application versions, you will experience some downtime. However, it is possible to avoid this downtime by swapping the CNAMEs for your environments. This section walks you through how to perform a CNAME swap using the AWS Management Console, the command line interface, or APIs. [emphasis mine]

关于deployment - 如何防止在 AWS Elastic Beanstalk 部署新版本应用程序期间停机?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11512011/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com