AWS Elastic Beanstalk - how to stop previous docker before starting new one

跟風遠走 提交于 2021-02-08 23:38:07

问题


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.

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.


回答1:


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

  1. Open the Elastic Beanstalk console.
  2. Navigate to the management page for your environment.
  3. Choose Configuration.
  4. In the Rolling updates and deployments configuration category, choose Modify.
  5. Select immutable on deploy policy
  6. Apply

you can check more on how it works here



来源:https://stackoverflow.com/questions/60896273/aws-elastic-beanstalk-how-to-stop-previous-docker-before-starting-new-one

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!