问题
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
- Open the Elastic Beanstalk console.
- Navigate to the management page for your environment.
- Choose Configuration.
- In the Rolling updates and deployments configuration category, choose Modify.
- Select immutable on deploy policy
- 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