追蹤 Amazon ECS 可用區域重新平衡 - Amazon Elastic Container Service

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

追蹤 Amazon ECS 可用區域重新平衡

您可以透過主控台或呼叫 describe-services 來驗證服務是否已啟用可用區域重新平衡。下列範例可用來查看 CLI 的狀態。

回應將為 ENABLEDDISABLED

aws ecs describe-services \ --services service-name \ --cluster cluster-name \ --query services[0].availabilityZoneRebalancing

服務事件

Amazon ECS 會傳送服務動作事件,協助您了解可用區域重新平衡生命週期。

事件 案例 Type 進一步了解
SERVICE_REBALANCING_STARTED Amazon ECS 啟動可用區域重新平衡操作 INFO service (service-name) is not AZ balanced with number-tasks tasks in Availability Zone 1, number-tasks in Availability Zone 2, and number-tasks in Availability Zone 3. AZ Rebalancing in progress.
SERVICE_REBALANCING_COMPLETED 可用區域重新平衡操作完成 INFO service (service-name) is AZ balanced with number-tasks tasks in Availability Zone 1, number-tasks tasks in Availability Zone 2, and number-tasks tasks in Availability Zone 3.
TASKS_STARTED Amazon ECS 在可用區域重新平衡操作中成功啟動任務 INFO service-name has started number-tasks tasks in Availability Zone to AZ Rebalance: task-ids.
TASKS_STOPPED Amazon ECS 在可用區域重新平衡操作中成功停止任務 INFO service-name has stopped number-tasks running tasks in Availability Zone due to AZ rebalancing: task-id.
SERVICE_TASK_PLACEMENT_FAILURE Amazon ECS 在可用區域重新平衡操作中啟動任務失敗 ERROR 對於 EC2,請參閱service (service-name) is unable to place a task in Availability Zone because no container instance met all of its requirements.

對於 Fargate,請參閱service (service-name) is unable to place a task in Availability Zone.

TASKSET_SCALE_IN_FAILURE_BY_TASK_PROTECTION 由於任務保護正在使用中,因此會封鎖可用區域重新平衡操作。 INFO service (service-name) was unable to AZ Rebalance because task-set-name was unable to scale in due to reason.
SERVICE_REBALANCING_STOPPED 可用區域重新平衡操作停止。Amazon ECS 會傳送提供詳細資訊的額外事件。 INFO service (service-name) stopped AZ Rebalancing.

任務狀態變更事件

Amazon ECS 會針對在重新平衡程序中啟動的每項任務傳送任務狀態變更事件 (START)。

Amazon ECS 會針對在重新平衡程序中停止的每項任務傳送任務狀態變更事件 (STOPPED)。原因設定為 Availability-zone rebalancing initiated by (deployment ecs-svc/deployment-id)

如需有關事件的詳細資訊,請參閱 Amazon ECS 任務狀態變更事件