简体   繁体   English

如何通过自动缩放来扩展 ecs 集群?

[英]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所以我认为流程就像

  • You get more requests您收到更多请求
  • Your tasks need more resources (cpu/memory)您的任务需要更多资源(cpu/内存)
  • Your ecs task autoscaling kicks in and creates more task您的 ecs 任务自动缩放启动并创建更多任务
  • your ec2 autoscaling also kicks in and creates more ec2您的 ec2 自动缩放也会启动并创建更多 ec2

Questions问题

  1. your ecs needs to know newly launched ec2 (from ec2 autoscaling group) is the host that it can run on (how?)您的 ecs 需要知道新启动的 ec2(来自 ec2 自动缩放组)是它可以运行的主机(如何?)
  2. 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 开始?
  3. 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 个实例开始吗?

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.

相关问题 AWS ECS集群自动扩展 - AWS ECS Cluster Autoscaling 如何为使用计划任务且无服务的 ECS 集群设置自动伸缩? - How to set up autoscaling for ECS cluster that uses scheduled tasks and no service? 自动缩放在ECS中如何工作? - How Autoscaling works in ECS? 在群集中的特定自动伸缩组上启动ECS服务 - Launch ECS Service on a specific Autoscaling Group in a Cluster 当集群可用内存不足时如何对ECS实例执行AWS CloudFormation自动扩展 - How to perform AWS CloudFormation autoscaling for ECS instance when cluster has insufficient memory available 如何使用AWS开发工具包以编程方式扩展ECS集群 - How to programmatically scale up an ECS cluster with the AWS SDK 我无法使用Terraform将自动扩展组分配给ECS集群 - I'm not able to assign autoscaling group to ECS cluster using Terraform 无法创建具有自动缩放功能的 Ec2 实例并将其注册到 ECS 集群 - Unable to create Ec2 instance with autoscaling and register them to ECS cluster 如何使用 aws 自动缩放(ecs 或 beanstalk 或简单的自动缩放)在 django 中收集日志 - how to gather logs in django with aws autoscaling (ecs or beanstalk or simple autoscaling) 如何设置 ECS 自动缩放? - How do i setup ECS autoscaling?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM