服务无法放置任务,因为没有容器实例满足要求。最接近的匹配容器实例的CPU单元不足

时间:2020-01-11 09:49:15

标签: amazon-ec2 containers terraform

我正在尝试在同一EC2容器上运行2个任务。 EC2容器正在t2.large类型的EC2实例上运行。 任务之一(它是守护程序)可以正常启动,并且为RUNNING。 另一个任务是应用程序,无法启动,并且在“事件”选项卡中看到以下错误。

service test-service was unable to place a task because no container instance met all of its requirements. The closest matching container-instance xxxxxx has insufficient CPU units available. For more information, see the Troubleshooting section.

service test-service was unable to place a task because no container instance met all of its requirements. The closest matching container-instance xxxxxx has insufficient memory available. For more information, see the Troubleshooting section.

我查看了容器实例的CPU和内存部分,其值为-

       Registered  Available
CPU    1024         1014
Memory  985         729

对于未运行的任务,我的任务定义具有以下CPU和内存值-

    "memory": 512,
    "cpu": 10

在同一EC2容器实例上成功运行的守护程序的内存和CPU值也相同。

我在https://aws.amazon.com/premiumsupport/knowledge-center/ecs-container-instance-requirement-error/处通过AWS文档进行了阅读,并试图减少测试服务任务定义的CPU和内存需求,但没有任何帮助。我还将实例类型更改为更大的值,但这也无济于事。

有人可以帮我完成两个任务(守护程序和应用程序)的CPU和内存工作,以便它们可以在同一EC2容器实例上运行吗?

注意:我无法将其他容器添加到ECS集群中。

1 个答案:

答案 0 :(得分:0)

任务定义将CPU限制设置为10个单位,这在您的情况下可能不足。将该值设置为0时,ECS可以动态管理CPU资源。但是,如果有内存,则不可能。

相关问题