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

Amazon ec2 服务无法放置任务,因为没有满足要求的容器实例。最近匹配的容器实例没有足够的CPU单元,amazon-ec2,containers,terraform,Amazon Ec2,Containers,Terraform,我试图在同一个EC2容器上运行两个任务。EC2容器正在t2.大型类型EC2实例上运行。 其中一个任务(作为守护进程)启动正常,正在运行。 另一个任务是应用程序,没有启动,我在Events选项卡中看到以下错误 service test-service was unable to place a task because no container instance met all of its requirements. The closest matching container-instance

我试图在同一个EC2容器上运行两个任务。EC2容器正在
t2.大型
类型EC2实例上运行。
其中一个任务(作为守护进程)启动正常,正在运行。
另一个任务是应用程序,没有启动,我在Events选项卡中看到以下错误

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值也相同

我在这里通读了AWS文档,并试图减少测试服务任务定义的CPU和内存需求,但没有任何帮助。我还将实例类型更改为更大的类型,但这也没有帮助

有人能帮我做些什么吗?我应该为这两个任务(守护进程和应用程序)的CPU和内存做些什么,这样它们就可以在同一个EC2容器实例上运行


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

任务定义将CPU限制设置为10个单元,这在您的情况下可能不够。当您将该值设置为0时,ECS可以动态管理CPU资源。然而,在内存的情况下,这是不可能的