为什么ecs-cli服务启动未完成很长时间

时间:2019-07-02 15:27:40

标签: amazon-web-services docker docker-compose amazon-ecs

我想将docker项目上传到AWS ECS。 但是我遇到了这个错误。

INFO[0291] (service myappproject) has started 1 tasks: (task 38184a9c-ff93-4324-b586-424fc025655d).  timestamp="2019-07-02 13:41:45 +0000 UTC"
FATA[0306] Deployment has not completed: Running count has not changed for 5.00 minutes

我使用docker-compose通过ecs-cli上传python和nginx项目。

这是我的ecs-cli命令。

ecs-cli \
    compose \
        --verbose \
        --file docker-compose.yml \
        --file docker-compose.production.yml \
        --ecs-params ecs-params.yml \
        --region ap-northeast-1 \
        --cluster myapp \
        --project-name myappproject \
    service up \
        --target-group-arn arn:aws:elasticloadbalancing:ap-northeast-1:294598740507:targetgroup/tsujimoto-app-alb-target-group/41c164d963f49806 \
        --container-name nginx \
        --container-port 80 \
        --force-deployment true \
        --timeout 10

这是我的ecs-param.yml

ersion: 1
task_definition:
  ecs_network_mode: awsvpc
  task_execution_role: ecs-task-execution
  task_size:
    cpu_limit: 256
    mem_limit: 512
  services:
    myapp:
      essential: true
    nginx:
      essential: true


run_params:
  network_configuration:
    awsvpc_configuration:
      subnets:
        - subnet-096df842a99829e4f
        - subnet-07c7f04d0b61c3346
      security_groups:
        - sg-09d046dd7faac15f4

有人知道吗?

1 个答案:

答案 0 :(得分:0)

我发现网络无法访问docker映像。 我在ecs-params.yml中添加了“ assign_public_ip:ENABLED”,并成功创建了项目。