简体   繁体   English

多个EC2实例中的AWS ECS

[英]AWS ECS in multiple EC2 Instances

是否可以创建同时在多个EC2实例中运行容器的ECS,或者是否需要为每个EC2实例创建1个任务?

As per the clarification by you in the comment. 根据您在评论中的澄清。 I believe you are looking for a solution to run a highly available application which should have multiple containers so that you won't have to face downtime when you will drain the underlying EC2 instance. 我相信您正在寻找一种解决方案来运行高度可用的应用程序,该应用程序应具有多个容器,这样您在耗尽基础EC2实例时就不必面对停机时间。

In this particular scenario, you have to use ECS service with SPREAD as task placement strategy. 在这种情况下,您必须将带有SPREAD的ECS服务用作任务放置策略。 ECS will automatically take care of the high availability of application by placing containers on the different EC2 instance of that cluster. 通过将容器放置在该群集的不同EC2实例上,ECS将自动照顾应用程序的高可用性。 So, When you replace the underlying ec2 instance it will first drain all the connections to the containers which were running on that instance. 因此,当您替换基础ec2实例时,它将首先清空与该实例上运行的容器的所有连接。

You can read more about ECS Service here: 您可以在此处阅读有关ECS服务的更多信息:

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html

Task Placement Strategy: 任务放置策略:

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html

Do let me know for further clarification. 请让我知道进一步澄清。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM