如何使用自动缩放来扩展 ecs 集群?
How to scale ecs cluster with autoscaling?
我认为你有 2 个缩放
1 for ec2 instance
1 for ecs task
所以我认为流程是这样的
- 您收到更多请求
- 您的任务需要更多资源(cpu/memory)
- 您的 ecs 任务自动缩放启动并创建更多任务
- 您的 ec2 自动缩放也会启动并创建更多 ec2
问题
- 您的 ecs 需要知道新启动的 ec2(来自 ec2 自动缩放组)是它可以 运行 在(如何?)
上的主机
- 我希望ec2实例的数量从一个开始。
我认为一个实例已经 运行ning 在 ecs 集群中
我是否让 ec2 自动缩放组从 0 开始?
- ec2 autoscaling 组有使用 spot 实例的定价选项,但我在创建 ecs 集群实例时没有看到这样的选项。明确一点,我可以用 0 个 ecs-instance 创建 ecs 集群,并让 ec2 autoscaling group 从 1 个实例开始吗?
Your ecs task autoscaling kicks in and creates more task
your ec2 autoscaling also kicks in and creates more ec2
你的ECS task scale如果有内存那么好它会缩放并启动新的容器,如果内存不够那么它不会启动一个实例,你需要配置cloud watch alarm来根据任务扩展。
Tutorial: Scaling Container Instances with CloudWatch Alarms
your ecs needs to know newly launched ec2 (from ec2 autoscaling group)
is the host that it can run on (how?)
ECS 代理将新实例注册到同一个集群,新任务可以放置在任何有可用资源来处理和启动容器的实例中。
I want the number of ec2 instance starts from one. I think one
instance is already running in the ecs cluster Do I make ec2
autoscaling group start from 0?
您应该从 1 开始,否则容器将不会启动,并且会抛出错误 no instance found in the cluster。如果您暂时不需要 运行 容器,那么您可以从 0.
开始
ec2 autoscaling group has pricing option to use spot instance, but I
didn't see such option when I created ecs cluster instances. To be
clear, can I make ecs cluster with 0 ecs-instance, and let ec2
autoscaling group starts with 1 instance?
您可以阅读现货ECS集群实例here。
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.
ECS already handles the placement and scheduling of containers on EC2
instances. When combined with Spot fleet, ECS can deliver significant
savings over EC2 on-demand pricing.
我认为你有 2 个缩放
1 for ec2 instance
1 for ecs task
所以我认为流程是这样的
- 您收到更多请求
- 您的任务需要更多资源(cpu/memory)
- 您的 ecs 任务自动缩放启动并创建更多任务
- 您的 ec2 自动缩放也会启动并创建更多 ec2
问题
- 您的 ecs 需要知道新启动的 ec2(来自 ec2 自动缩放组)是它可以 运行 在(如何?) 上的主机
- 我希望ec2实例的数量从一个开始。 我认为一个实例已经 运行ning 在 ecs 集群中 我是否让 ec2 自动缩放组从 0 开始?
- ec2 autoscaling 组有使用 spot 实例的定价选项,但我在创建 ecs 集群实例时没有看到这样的选项。明确一点,我可以用 0 个 ecs-instance 创建 ecs 集群,并让 ec2 autoscaling group 从 1 个实例开始吗?
Your ecs task autoscaling kicks in and creates more task your ec2 autoscaling also kicks in and creates more ec2
你的ECS task scale如果有内存那么好它会缩放并启动新的容器,如果内存不够那么它不会启动一个实例,你需要配置cloud watch alarm来根据任务扩展。
Tutorial: Scaling Container Instances with CloudWatch Alarms
your ecs needs to know newly launched ec2 (from ec2 autoscaling group) is the host that it can run on (how?)
ECS 代理将新实例注册到同一个集群,新任务可以放置在任何有可用资源来处理和启动容器的实例中。
I want the number of ec2 instance starts from one. I think one instance is already running in the ecs cluster Do I make ec2 autoscaling group start from 0?
您应该从 1 开始,否则容器将不会启动,并且会抛出错误 no instance found in the cluster。如果您暂时不需要 运行 容器,那么您可以从 0.
开始ec2 autoscaling group has pricing option to use spot instance, but I didn't see such option when I created ecs cluster instances. To be clear, can I make ecs cluster with 0 ecs-instance, and let ec2 autoscaling group starts with 1 instance?
您可以阅读现货ECS集群实例here。
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. ECS already handles the placement and scheduling of containers on EC2 instances. When combined with Spot fleet, ECS can deliver significant savings over EC2 on-demand pricing.