gpt4 book ai didi

amazon-web-services - 用于多容器 docker 的 Elastic beanstalk 与 ECS

转载 作者:行者123 更新时间:2023-12-05 00:16:53 25 4
gpt4 key购买 nike

在多容器系统上工作。我正在评估 Elastic Beanstalk 和 ECS 的优缺点。有很多问题,比如this这表示与 EB 相比,ECS 对容器的控制更精确,但它们尚未列出。在我看来,这是它们之间的区别:

+--------------------------------------------+--------------------------------------------------+
| Elastic Beanstalk | ECS |
+--------------------------------------------+--------------------------------------------------+
| Natively support auto-scaling and load | Auto-scaling can be done with |
| balancing. Has the ability to deploy | some extra efforts. But other AWS resources |
| other AWS resources along with the | cannot be deployed with ECS. |
| containers. | |
+--------------------------------------------+--------------------------------------------------+
| Container definitions are written in | Container definitions has to be written in a |
| dockerrun.aws.json file. All the links | separate task definition file. Scaling of the |
| can be written here. This is more like | container can be specified in |
| docker compose file. | service definitions. |
+--------------------------------------------+--------------------------------------------------+
| Scaling happens based on CloudWatch | Here, we have a precise control to scale |
| metric. But when a new instance is | a particular task (container). This is more |
| launched, the whole containers in | like declarative. It does not take in to account |
| task definition file will be launched | about the instances, it maintains the count of |
| again (imperative), even though some | tasks correctly. Scales based on the |
| of the containers actually has no traffic. | CPU/Memory usage of a specific container. |
+--------------------------------------------+--------------------------------------------------+

我不确定第三点。如果我错了,请纠正我。如果这两者之间还有其他差异,请告诉我。

最佳答案

第一点:如果您不使用 Elastic Beanstalk 并希望将其他 AWS 资源与您的应用程序一起部署,请创建一个 CloudFormation 模板并使用 CloudFormation 更改集来启动、升级和拆除您的应用程序。

关于第三点,Elastic Beanstalk 使用了 AWS Auto Scaling 功能,该功能仅适用于创建和删除 EC2 实例的级别。因此,如果您在 Elastic Beanstalk 中使用单容器/多容器环境,向上扩展不仅会创建另一个容器,还会创建一个运行 Docker 的整个 EC2 实例,其中包含所有相同的容器。 Auto Scaling 也可以从 CloudFormation 模板中使用,而无需使用 Elastic Beanstalk。它仍然只适用于 EC2 实例级别。

另一种选择是使用 Elastic Beanstalk 及其 Auto Scaling,将环境设置为具有您要扩展的容器的单个容器 docker,并将其他容器添加为 AWS::ECS::Service custom resources .例如,您的单个容器可以是处理繁重的前端,而另一个容器可以是共享数据存储。通过这种方式,您可以从 Elastic Beanstalk 获得不错的版本控制/部署/推出,但具有单实例的容器(每个 Elastic Beanstalk 环境)。

关于amazon-web-services - 用于多容器 docker 的 Elastic beanstalk 与 ECS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41265885/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com