大网数据广告活动
服务器运维问答

AWS ECS service not starting any tasks

· 52CE 我爱测

I've set up a cluster, container, task and service on ECS. After I created the service, it appears to be running with '3 desired tasks', however no tasks are being created as pending or running. Effectively it seems to be doing n…

问题原文

原帖链接 · Jack3311 · CC BY-SA 4.0

I've set up a cluster, container, task and service on ECS.

After I created the service, it appears to be running with '3 desired tasks', however no tasks are being created as pending or running. Effectively it seems to be doing nothing.

My task definition (excluding nulls and empty arrays) is

{
  "containerDefinitions": [
    {
      "portMappings": [
        {
          "hostPort": 5000,
          "protocol": "tcp",
          "containerPort": 25565
        },
        {
          "hostPort": 5000,
          "protocol": "udp",
          "containerPort": 25565
        }
      ],
      "cpu": 0,
      "memoryReservation": 1024,
      "image": "itzg/bungeecord",
      "essential": true,
      "name": "BungeeCord"
    }
  ],
  "compatibilities": [
    "EC2"
  ],
  "taskDefinitionArn": "arn:aws:ecs:us-west-1:949960343466:task-definition/BungeeCordTask:3",
  "family": "BungeeCordTask",
  "requiresAttributes": [
    {
      "name": "com.amazonaws.ecs.capability.docker-remote-api.1.21"
    }
  ],
  "requiresCompatibilities": [
    "EC2"
  ],
  "revision": 3,
  "status": "ACTIVE",
}

My cluster has 3 ECS instances, which are all running and have nothing on them: My cluster

My service is here: My service

I don't have any auto-scaling, load balancing or anything set up. But I do have some really default service discovery.

Anybody have any ideas why no tasks are starting?

Edit:

  • I've had a look at the "Stopped tasks" and it's actually empty.
  • I also SSH'd into each of my ec2 instances, and had a look through /var/log: I found a folder /var/log/ecs with some log files, but there are no errors or anything relating to my task specifically. It seems to be successfully polling a amazon web endpoint for updates.
  • I also ran curl google.com to verify that they have external access.

社区高分解答

原帖链接 · davegallant · CC BY-SA 4.0

I'd check your Events tab in the ECS service. In some cases it will tell you there isn't enough memory to start the container. It's a bit tricky to find without knowing, since it's buried in a tab within the service. I'd expect some events must have occured.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-08-05)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。