duanhua5523 2017-07-11 13:16
浏览 67

AWS Multi-docker在任务退出时部署Essential容器

I'm having this problem on deploying my local docker config to AWS:

ERROR: ECS task stopped due to: Essential container in task exited. (benj-elasticsearch: benj-nginx: benj-php-fpm: )

The error log:

+ RETRY=0
+ initctl start eb-ecs EB_EVENT_FILE=/tmp/eventsfile20170711-9737-o42dsc
initctl: Job failed to start
+ '[' -f /etc/elasticbeanstalk/.eb-ecs-start-no-retry ']'
+ warn 'Failed to start ECS task, retrying...'
+ echo 'Failed to start ECS task, retrying...'
Failed to start ECS task, retrying...
+ eventHelper.py --msg 'Failed to start ECS task, retrying...' --severity WARN
+ RETRY=1
+ sleep 3
+ '[' 1 -gt 1 ']'
+ initctl start eb-ecs EB_EVENT_FILE=/tmp/eventsfile20170711-9737-o42dsc
initctl: Job failed to start
+ '[' -f /etc/elasticbeanstalk/.eb-ecs-start-no-retry ']'
+ warn 'Failed to start ECS task, retrying...'
+ echo 'Failed to start ECS task, retrying...'
Failed to start ECS task, retrying...
+ eventHelper.py --msg 'Failed to start ECS task, retrying...' --severity WARN
+ RETRY=2
+ sleep 3
+ '[' 2 -gt 1 ']'
+ error_exit 'Failed to start ECS task after retrying 2 times.' 1
+ error 'Failed to start ECS task after retrying 2 times.'
+ echo 'Failed to start ECS task after retrying 2 times.'
Failed to start ECS task after retrying 2 times.
+ eventHelper.py --msg 'Failed to start ECS task after retrying 2 times.' --severity ERROR
+ exit 1 (ElasticBeanstalk::ExternalInvocationError)
caused by: + . /opt/elasticbeanstalk/hooks/common.sh
+ RETRY=0
+ initctl start eb-ecs EB_EVENT_FILE=/tmp/eventsfile20170711-9737-o42dsc
initctl: Job failed to start
+ '[' -f /etc/elasticbeanstalk/.eb-ecs-start-no-retry ']'
+ warn 'Failed to start ECS task, retrying...'
+ echo 'Failed to start ECS task, retrying...'
Failed to start ECS task, retrying...
+ eventHelper.py --msg 'Failed to start ECS task, retrying...' --severity WARN
+ RETRY=1
+ sleep 3
+ '[' 1 -gt 1 ']'
+ initctl start eb-ecs EB_EVENT_FILE=/tmp/eventsfile20170711-9737-o42dsc
initctl: Job failed to start
+ '[' -f /etc/elasticbeanstalk/.eb-ecs-start-no-retry ']'
+ warn 'Failed to start ECS task, retrying...'
+ echo 'Failed to start ECS task, retrying...'
Failed to start ECS task, retrying...
+ eventHelper.py --msg 'Failed to start ECS task, retrying...' --severity WARN
+ RETRY=2
+ sleep 3
+ '[' 2 -gt 1 ']'
+ error_exit 'Failed to start ECS task after retrying 2 times.' 1
+ error 'Failed to start ECS task after retrying 2 times.'
+ echo 'Failed to start ECS task after retrying 2 times.'
Failed to start ECS task after retrying 2 times.
+ eventHelper.py --msg 'Failed to start ECS task after retrying 2 times.' --severity ERROR
+ exit 1 (Executor::NonZeroExitStatus)

Some remarks:

So I have my local docker-compose.yml. I ported this to the Dockerrun.aws.js BUT because I use my own container (bensji/php-fpm), I had to deploy that container to the cloud.

These are my files: Dockerrun.aws.js

{
"AWSEBDockerrunVersion": 2,
"volumes": [
  {
    "name": "benj",
    "host": {
      "sourcePath": "/var/app/current"
    }
  },
  {
    "name": "fpmconf",
    "host": {
      "sourcePath": "/var/app/current/docker/production/php-fpm"
    }
  },
  {
    "name": "nginxconf",
    "host": {
      "sourcePath": "/var/app/current/docker/production/nginx"
    }
  }
],
"containerDefinitions": [
  {
    "name": "benj-nginx",
    "image": "phpdockerio/nginx:latest",
    "essential": true,
    "memory": 128,
    "environment": [
      {
        "name": "Container",
        "value": "nginx"
      }
    ],
    "portMappings": [
      {
        "hostPort": 80,
        "containerPort": 80
      }
    ],
    "links": [
      "benj-php-fpm"
    ],
    "mountPoints": [
      {
        "sourceVolume": "benj",
        "containerPath": "/var/www/benj",
        "readOnly": true
      },
      {
        "sourceVolume": "nginxconf",
        "containerPath": "/usr/local/nginx/conf",
        "readOnly": true
      }
    ]
  },
  {
    "name": "benj-php-fpm",
    "image": "bensji/php-fpm:latest",
    "environment": [
      {
        "name": "Container",
        "value": "php-fpm"
      }
    ],
    "essential": true,
    "memory": 128,
    "mountPoints": [
      {
        "sourceVolume": "benj",
        "containerPath": "/var/www/benj"
      },
      {
        "sourceVolume": "fpmconf",
        "containerPath": "/usr/local/php/etc",
        "readOnly": true
      }
    ]
  },
  {
    "name": "benj-elasticsearch",
    "image": "docker.elastic.co/elasticsearch/elasticsearch:5.4.0",
    "environment": [
      {
        "name": "Container",
        "value": "elasticsearch"
      }
    ],
    "memory": 128,
    "portMappings": [
      {
        "hostPort": 9200,
        "containerPort": 9200
      }
    ]
  }
]

}

Thank you.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥50 如何用脚本实现输入法的热键设置
    • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
    • ¥30 深度学习,前后端连接
    • ¥15 孟德尔随机化结果不一致
    • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
    • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
    • ¥15 谁有desed数据集呀
    • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
    • ¥15 关于#hadoop#的问题
    • ¥15 (标签-Python|关键词-socket)