简体   繁体   English

Amazon ECS自动扩展会启动和终止Amazon EC2服务器吗?

[英]Will Amazon ECS autoscaling start and terminate Amazon EC2 servers?

I set up autoscaling from the Amazon ECS service settings for my app with a minimum of 1 task and max of 4. I'm using docker containers. 我为我的应用程序的Amazon ECS服务设置设置了自动缩放,最少1个任务,最多4个。我正在使用docker容器。

Will this spin up and terminate Amazon EC2 servers automatically? 这会自动启动并终止Amazon EC2服务器吗?

No, you need to set up cloud watch alarm for scaling cluster. 不,您需要为扩展群集设置云监视警报。 The Auto Scaling group contains container instances that you can scale up (and down) using CloudWatch alarms. Auto Scaling组包含可以使用CloudWatch警报向上(和向下)扩展的容器实例。 But in case of Fargate , Clusters with Fargate tasks can be scaled using Service Auto Scaling . 但是对于Fargate ,可以使用Service Auto Scaling扩展具有Fargate任务的集群。

Depending on the Amazon EC2 instance types that you use in your clusters, and quantity of container instances that you have in a cluster, your tasks have a limited amount of resources that they can use while running. 根据您在群集中使用的Amazon EC2实例类型以及群集中的容器实例数量,您的任务在运行时可以使用有限的资源。 Amazon ECS monitors the resources available in the cluster to work with the schedulers to place tasks. Amazon ECS监视群集中可用的资源,以便与调度程序一起执行任务。 If your cluster runs low on any of these resources, such as memory, you are eventually unable to launch more tasks until you add more container instances, reduce the number of desired tasks in a service, or stop some of the running tasks in your cluster to free up the constrained resource. 如果您的群集在任何这些资源(例如内存)上运行不足,则在添加更多容器实例,减少服务中所需任务的数量或停止群集中的某些正在运行的任务之前,最终无法启动更多任务释放受限资源。

You can read more about auto-scaling with ECS cluster in Tutorial: Scaling Container Instances with CloudWatch Alarms . 您可以在教程:使用CloudWatch警报扩展容器实例中阅读有关使用ECS群集进行自动扩展的更多信息。

You can scale manually using this approach: 您可以使用此方法手动缩放:

  • Open the Amazon ECS console 打开Amazon ECS控制台

  • From the navigation bar, choose the Region in which your cluster exists. 从导航栏中,选择群集所在的区域。

  • In the navigation pane, choose Clusters and select the cluster to scale. 在导航窗格中,选择Clusters并选择要缩放的群集。

  • On the Cluster: name page, choose ECS Instances . 在Cluster:name页面上,选择ECS Instances

  • Choose Scale ECS Instances . 选择Scale ECS Instances
  • For Desired number of instances , enter the number of instances to which to scale your cluster and choose Scale. 对于所需的实例数 ,请输入要将群集扩展到的实例数,然后选择“缩放”。

See: Scaling a Cluster - Amazon Elastic Container Service 请参阅: 扩展群集 - Amazon Elastic Container Service

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

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