[英]How to scale ecs cluster with autoscaling?
I think you have 2 scaling我认为您有 2 个缩放比例
1 for ec2 instance
1 for ecs task
So I think flow goes like所以我认为流程就像
Questions问题
Your ecs task autoscaling kicks in and creates more task your ec2 autoscaling also kicks in and creates more ec2您的 ecs 任务自动缩放启动并创建更多任务您的 ec2 自动缩放也启动并创建更多 ec2
Your ECS task scale if there is a memory so fine it will scale and launch new container, if not enough memory then it will not launch an instance, you need to configure cloud watch alarm to scale ECS cluster based on the task scaling.您的 ECS 任务规模如果有 memory 很好,它将扩展并启动新容器,如果没有足够的 memory 则不会启动实例,您需要配置云监视警报以根据任务扩展扩展 ECS 集群。
Tutorial: Scaling Container Instances with CloudWatch Alarms 教程:使用 CloudWatch 警报扩展容器实例
your ecs needs to know newly launched ec2 (from ec2 autoscaling group) is the host that it can run on (how?)您的 ecs 需要知道新启动的 ec2(来自 ec2 自动缩放组)是它可以运行的主机(如何?)
ECS agent registers the new instance with the same cluster, and the new task can be placed in any instance that have available resources to handle and launch the container. ECS 代理将新实例注册到同一个集群,新任务可以放置在任何有可用资源来处理和启动容器的实例中。
I want the number of ec2 instance starts from one.我希望 ec2 实例的数量从一个开始。 I think one instance is already running in the ecs cluster Do I make ec2 autoscaling group start from 0?我认为一个实例已经在 ecs 集群中运行我是否让 ec2 自动缩放组从 0 开始?
You should start from 1 otherwise no container will launch and will throw error no instance found in the cluster.您应该从 1 开始,否则不会启动任何容器,并且会抛出错误 no instance found in the cluster。 if you do not want run container for now then you can start from 0.如果你现在不想运行容器,那么你可以从 0 开始。
ec2 autoscaling group has pricing option to use spot instance, but I didn't see such option when I created ecs cluster instances. ec2 autoscaling group 有使用现货实例的定价选项,但是我在创建 ecs 集群实例时没有看到这样的选项。 To be clear, can I make ecs cluster with 0 ecs-instance, and let ec2 autoscaling group starts with 1 instance?需要明确的是,我可以用 0 个 ecs-instance 制作 ecs 集群,并让 ec2 自动缩放组从 1 个实例开始吗?
You can read about spot ECS cluster instance here .您可以在此处阅读有关现货 ECS 集群实例的信息。
Amazon ECS is a highly scalable, high performance, container management service that supports Docker containers and allows you to run applications on a managed cluster of Amazon EC2 instances easily. Amazon ECS 是一种高度可扩展、高性能的容器管理服务,支持 Docker 容器,并允许您在 Amazon EC2 实例的托管集群上轻松运行应用程序。 ECS already handles the placement and scheduling of containers on EC2 instances. ECS 已经处理了容器在 EC2 实例上的放置和调度。 When combined with Spot fleet, ECS can deliver significant savings over EC2 on-demand pricing.与 Spot 队列结合使用时,ECS 可以比 EC2 按需定价显着节省成本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.