由于cpu单元不足和超时,导致ECS部署失败

时间:2020-01-26 14:40:39

标签: amazon-web-services amazon-ec2 amazon-ecs

我刚刚使用pip install ecs-deploy安装了ecs-deploy。当我尝试部署时遇到类似这样的错误

我第一次得到:

Deploying based on task definition: task-demo:2

Creating new task definition revision
Successfully created revision: 3

Updating service
Successfully changed task definition to: task-demo:3

Deploying new task definition..........
2020-01-26 14:12:57.563000+00:00
ERROR: (service demo-service) was unable to place a task because no container instance met all of its requirements. The closest matching (container-instance ba93b620-89fa-4970-bf54-535a373d1aba) has insufficient CPU units available. For more information, see the Troubleshooting section of the Amazon ECS Developer Guide.

Deployment failed

从第二次开始:

Deploying based on task definition: task-demo:5

Creating new task definition revision
Successfully created revision: 6

Updating service
Successfully changed task definition to: task-demo:6

Deploying new task definition...................................................................................................................................................................................................................................................................................................
Deployment failed due to timeout. Please see: https://github.com/fabfuel/ecs-deploy#timeout

1 个答案:

答案 0 :(得分:1)

如果用于任务放置的最接近的匹配容器实例没有足够的CPU单元来满足任务定义的要求,则会收到此错误消息。

您将要检查容器实例上剩余的CPU单元,并进行调整以满足CPU要求。

以下是解决此问题的资源:

https://aws.amazon.com/premiumsupport/knowledge-center/ecs-container-instance-cpu-error/

关于超时问题,请注意,ecs命令的部署和扩展操作允许通过--timeout参数定义超时(以秒为单位)。这指示ecs-deploy等待ECS完成给定秒数的部署。

请参见https://github.com/fabfuel/ecs-deploy#deployment-timeout

首先尝试解决CPU问题。超时问题很可能是相关的。

相关问题