[英]AWS ECS restrict to only one container instance
I want to only ever run one instance of my container to run at a given time.我只想在给定时间运行我的容器的一个实例。 For instance say my ECS container is writing data to an EFS.
例如,假设我的 ECS 容器正在将数据写入 EFS。 The application I am running is built in such a way that multiple instances can not be writing to this data at a given time.
我正在运行的应用程序的构建方式使得多个实例无法在给定时间写入此数据。 So is there a way to make sure that ECS never starts more than one instance.
那么有没有一种方法可以确保 ECS 永远不会启动多个实例。 I was worried that when one container was being torn down or stood up that two containers may end up running simultaneously.
我担心当一个容器被拆除或竖立时,两个容器可能会同时运行。
I was also thinking about falling back to EC2 so that I could meet this requirement but did want to try this out in ECS.我也在考虑回退到 EC2,这样我就可以满足这个要求,但我确实想在 ECS 中尝试一下。
I have tried setting the desired instances to 1 but I am worried that this will not work.我已尝试将所需实例设置为 1,但我担心这行不通。
Just set min, desired and maximum number of tasks to 1.只需将最小、期望和最大任务数设置为 1。
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-configure-auto-scaling.html#:~:text=To%20configure%20basic%20Service%20Auto%20Scaling%20parameters
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-configure-auto-scaling.html#:~:text=To%20configure%20basic%20Service%20Auto%20Scaling%20parameters
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.