Elastic Beanstalk 环境的 Auto Scaling 组

Posted cloudrivers

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Elastic Beanstalk 环境的 Auto Scaling 组相关的知识,希望对你有一定的参考价值。

您的 Elastic Beanstalk 包含一个 Auto Scaling 组,该组管理您环境中的 Amazon EC2 实例。在单实例环境中,Auto Scaling 组可确保始终有一个正在运行的实例。在负载均衡的环境中,您将为组配置一系列要运行的实例,Amazon EC2 Auto Scaling 将根据负载按需添加或删除实例。

Auto Scaling 组还会为您的环境中的实例管理启动配置。您可以修改启动配置,以更改实例类型、密钥对、Amazon Elastic Block Store (Amazon EBS) 存储和只能在启动实例时配置的其他设置。

Auto Scaling 组使用两个 Amazon CloudWatch 警报来触发扩展操作。当每个实例的平均出站网络流量在 5 分钟时间段内高于 6 MiB 或低于 2 MiB 时,默认触发器将扩展。要高效使用 Amazon EC2 Auto Scaling,请根据您的应用程序、实例类型和服务要求配置触发器。您可以基于若干个统计数据 (包括延迟、磁盘 I/O、CPU 使用率和请求计数) 来进行扩展。

要通过可预测的峰值流量期间来优化环境对 Amazon EC2 实例的使用,请配置 Auto Scaling 组以更改计划中的实例计数。您可以安排每天或每周重复一次的组配置更改,或安排一次性更改,以便为可为网站带来大量流量的营销活动做好准备。

Amazon EC2 Auto Scaling 可监控其启动的每个 Amazon EC2 实例的运行状况。如果任何实例意外终止,Amazon EC2 Auto Scaling 会检测该终止情况并启动替代实例。要配置组以使用负载均衡器的运行状况检查机制,请参阅 Auto Scaling 运行状况检查设置

Your Elastic Beanstalk includes an Auto Scaling group that manages the Amazon EC2 instances in your environment. In a single-instance environment, the Auto Scaling group ensures that there is always one instance running. In a load-balanced environment, you configure the group with a range of instances to run, and Amazon EC2 Auto Scaling adds or removes instances as needed, based on load.

The Auto Scaling group also manages the launch configuration for the instances in your environment. You can modify the launch configuration to change the instance type, key pair, Amazon Elastic Block Store (Amazon EBS) storage, and other settings that can only be configured when you launch an instance.

The Auto Scaling group uses two Amazon CloudWatch alarms to trigger scaling operations. The default triggers scale when the average outbound network traffic from each instance is higher than 6 MiB or lower than 2 MiB over a period of five minutes. To use Amazon EC2 Auto Scaling effectively, configure triggers that are appropriate for your application, instance type, and service requirements. You can scale based on several statistics including latency, disk I/O, CPU utilization, and request count.

To optimize your environment‘s use of Amazon EC2 instances through predictable periods of peak traffic, configure your Auto Scaling group to change its instance count on a schedule. You can schedule changes to your group‘s configuration that recur daily or weekly, or schedule one-time changes to prepare for marketing events that will drive a lot of traffic to your site.

Amazon EC2 Auto Scaling monitors the health of each Amazon EC2 instance that it launches. If any instance terminates unexpectedly, Amazon EC2 Auto Scaling detects the termination and launches a replacement instance. To configure the group to use the load balancer‘s health check mechanism, see Auto Scaling Health Check Setting.

以上是关于Elastic Beanstalk 环境的 Auto Scaling 组的主要内容,如果未能解决你的问题,请参考以下文章

如何使用 Terraform 为 Elastic Beanstalk 环境定义条件(每个环境)设置?

下载/检索现有的 Elastic Beanstalk 环境配置

Elastic Beanstalk Procfile 中不可用的环境变量

AWS Elastic Beanstalk - 针对不同环境的单独配置

新的 Elastic Beanstalk 环境不打印到日志

Elastic Beanstalk 最大环境变量长度