首页 > 解决方案 > ECS服务不断注销目标组和启动/停止任务

问题描述

我有一个 ECS 服务,它重复启动和停止在 EC2 ( m5.large) 启动类型容器上运行的任务。事件选项卡循环显示这些消息 -

service test-service deregistered 1 targets in target-group localhost-localhost-default

service test-service has begun draining connections on 1 tasks.

service test-service deregistered 1 targets in target-group localhost-localhost-default

service test-service has started 2 tasks: task 4e1569b3-a15c-4bac-85f7-396b530113a5 task d5651035-8e3d-48df-b457-d05e5b7be8db.

没有什么可以帮助理解可能发生的事情了。当我检查目标组本身时,实例不再注册到它。我已经分配memory: 1024cpu: 512应该足够的任务。

我能做些什么来了解这里的问题是什么?

标签: containersterraformamazon-ecs

解决方案


在这条线上,

service test-service has started 2 tasks: task 4e1569b3-a15c-4bac-85f7-396b530113a5 task d5651035-8e3d-48df-b457-d05e5b7be8db.

任务 ID 是一个超链接,当您单击它时,它将带您进入可以找到有关该特定任务的所有详细信息的页面。

这里有一个条目“停止原因”,它将显示任务停止的原因。

如果由于健康检查失败而停止,它将显示在事件页面本身。


推荐阅读