AWS Elastic Beanstalk-如何在启动新码头工人之前停止上一个码头工人 [英] AWS Elastic Beanstalk - how to stop previous docker before starting new one

查看:54
本文介绍了AWS Elastic Beanstalk-如何在启动新码头工人之前停止上一个码头工人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组使用基于Docker的Web服务器和辅助服务器配置的AWS Elastic beantalk.我们设置的方式是docker内部的java进程在启动时分配70%的内存.

I have a set of AWS Elastic beanstalk using Docker based configuration for both web server and worker server. The way we have setup is that the java process inside docker allocates 70% of the box memory when starting.

现在,第一个部署可以正常工作,但是当我尝试使用就地滚动更新来更新应用程序版本时,Elastic beanstalk尝试在停止现有容器之前,先用java进程启动另一个docker容器.由于Java服务器无法分配所需的内存,因此部署失败.在部署期间启动新实例之前,有什么方法可以设置AWS来杀死旧的docker实例?

Now the first deployment works fine, but when I try to update application version with in-place Rolling update, Elastic beanstalk tries to start an additional docker container with the java process before stopping the existing one. This fails the deploy as the Java server is not able to allocate the required memory. Is there a way that I can setup AWS to kill the old docker instance before starting the new one during deployment?

我什至尝试了附加批次的滚动,但是该批次仅适用于第一批次,而随后的批次则失败.

I even tried Rolling with additional batch, but that one only works for the first batch and then fails for subsequent ones.

推荐答案

不可变的更新可能是您的理想之选,它基本上可以在每次部署时完全重新创建EC2实例

immutable updates can be the way to go for you, it basically recreates the EC2 instances completely on every deploy

  1. 打开Elastic Beanstalk控制台.
  2. 导航到您环境的管理页面.
  3. 选择配置.
  4. 在滚动更新和部署"配置类别中,选择修改".
  5. 选择不可变的部署策略
  6. 应用

您可以在此处查看更多信息

这篇关于AWS Elastic Beanstalk-如何在启动新码头工人之前停止上一个码头工人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆