无法启动Elastic Beanstalk MultiContainer实例

时间:2017-04-05 08:41:19

标签: docker elastic-beanstalk amazon-elastic-beanstalk

我的Dockerrun.aws.json

{
  "AWSEBDockerrunVersion": 2,
  "Authintication": {
    "Bucket": "abc",
    "key": "config.json"
  },
  "containerDefinitions": [
    {
      "name": "data",
      "image": "id.dkr.ecr.eu-west-2.amazonaws.com/dbdata:latest",
      "essential": false,
      "memory": 512,
      "command" : [
       "/bin/bash"
      ]
    },
    {
      "name": "codebase",
      "image": "id.dkr.ecr.eu-west-2.amazonaws.com/codebase:latest",
      "essential": false,
      "memory": 512,
      "command" : [
       "/bin/bash"
      ]
    },
    {
      "name": "postgres",
      "image": "id.dkr.ecr.eu-west-2.amazonaws.com/postgres:latest",
      "essential": true,
      "memory": 1024,
      "volumesFrom": [
        {
          "sourceContainer": "data"
        }
      ],
      "portMappings": [
        {
          "hostPort": 5432,
          "containerPort": 5432
        }
      ],
      "links": [
        "data"
      ]
    },
    {
      "name": "boxer-api",
      "image": "id.dkr.ecr.eu-west-2.amazonaws.com/boxer-api:latest",
      "essential": true,
      "memory": 1024,
      "volumesFrom": [
        {
          "sourceContainer": "codebase"
        }
      ],
      "portMappings": [
        {
          "hostPort": 8080,
          "containerPort": 8080
        }
      ],
      "links": [
        "codebase",
        "postgres",
        "data"
      ]
    }
  ]
}

错误eb-activity.log

  

[2017-04-05T08:29:00.728Z] INFO [3738] - [应用程序部署   第一

     

Release@1/StartupStage1/AppDeployEnactHook/02update-credentials.sh]:

     

开始活动...... [2017-04-05T08:29:00.913Z] INFO [3738] -

     

[首先应用程序部署

     

Release@1/StartupStage1/AppDeployEnactHook/02update-credentials.sh]:

     

已完成活动。 [2017-04-05T08:29:00.914Z]资料[3738] -   [应用部署首先   Release@1/StartupStage1/AppDeployEnactHook/03start-task.sh]:开始   活动... [2017-04-05T08:30:37.520Z] INFO [3738] - [应用程序部署First Release@1/StartupStage1/AppDeployEnactHook/03start-task.sh]:活动   执行失败,因为:+。 /opt/elasticbeanstalk/hooks/common.sh
  + RETRY = 0 + initctl start eb-ecs EB_EVENT_FILE = / tmp / eventsfile20170405-3738-17c2sc0 initctl:Job

     

未能开始+' [' -f /etc/elasticbeanstalk/.eb-ecs-start-no-retry']' +警告'无法启动ECS任务,重试...' + echo'无法启动ECS任务,重试...'无法启动ECS任务,正在重试... + eventHelper.py --msg'无法启动ECS任务,正在重试...'    - 严重性警告+重试= 1 +睡眠3 +' [' 1 -gt 1']' + initctl启动eb-ecs

     

EB_EVENT_FILE = / tmp / eventsfile20170405-3738-17c2sc0 initctl:作业未能启动+' [' -f /etc/elasticbeanstalk/.eb-ecs-start-no-retry']' +警告'无法启动ECS任务,重试...' + echo'无法启动ECS任务,重试...'无法启动ECS任务,正在重试... + eventHelper.py --msg'无法启动ECS任务,正在重试...' - 严重性警告+重试= 2 +睡眠3 +' [' 2 -gt 1']' + error_exit'重试2次后无法启动ECS任务。' 1 +错误'重试2次后无法启动ECS任务。' + echo'重试2次后无法启动ECS任务。'无法启动

     重试2次后,

ECS任务。 + eventHelper.py --msg'重试2次后无法启动ECS任务。' --severity ERROR +退出1    (ElasticBeanstalk :: ExternalInvocationError)由:+引起。 /opt/elasticbeanstalk/hooks/common.sh + RETRY = 0 + initctl start eb-ecs EB_EVENT_FILE = / tmp / eventsfile20170405-3738-17c2sc0 initctl:作业无法启动+' [' -f /etc/elasticbeanstalk/.eb-ecs-start-no-retry']' +警告'无法启动ECS任务,重试...' + echo'无法启动ECS任务,重试...'无法启动ECS任务,正在重试... + eventHelper.py --msg'无法启动ECS任务,正在重试...' - 严重性警告+重试= 1 +睡眠3 +' [' 1 -gt 1']' + initctl启动eb-ecs

     

EB_EVENT_FILE = / tmp / eventsfile20170405-3738-17c2sc0 initctl:作业未能启动+' [' -f /etc/elasticbeanstalk/.eb-ecs-start-no-retry']' +警告'无法启动ECS任务,重试...' + echo'无法启动ECS任务,重试...'无法启动ECS任务,正在重试... + eventHelper.py --msg'无法启动ECS任务,正在重试...' - 严重性警告+重试= 2 +睡眠3 +' [' 2 -gt 1']' + error_exit'重试2次后无法启动ECS任务。' 1 +错误'重试2次后无法启动ECS任务。' + echo'重试2次后无法启动ECS任务。'无法启动

     重试2次后,

ECS任务。 + eventHelper.py --msg'重试2次后无法启动ECS任务。' --severity ERROR + exit 1(Executor :: NonZeroExitStatus)

ECS代理商日志:

  

2017-04-05T09:13:11Z [INFO]保存状态!模块=" statemanager"

     

2017-04-05T09:13:11Z [INFO]完成拉动容器postgres(id.dkr.ecr.eu-west-2.amazonaws.com/postgres:latest)(PULLED-> RUNNING)。锁定获取和拉动需要233ns。

     

2017-04-05T09:13:11Z [关键]任务处于不良状态;它不稳定,但没有容器想要转换模块=" TaskEngine" task =" awseb-ebsBoxer-env-y9jmnnjnnm:3 arn:aws:ecs:eu-west-2:443611395156:task / f510bd3f-5b97-4fbe-af6c-61e037b08a29,状态:( NONE-> RUNNING)容器:[代码库(STOPPED-> RUNNING),postgres(PULLED-> RUNNING),数据(STOPPED-> RUNNING),]"

     

2017-04-05T09:13:11Z [关键]由于状态模块错误导致任务停止=" TaskEngine" task =" awseb-ebsBoxer-env-y9jmnnjnnm:3 arn:aws:ecs:eu-west-2:443611395156:task / f510bd3f-5b97-4fbe-af6c-61e037b08a29,状态:( NONE-> RUNNING)容器:[代码库(STOPPED-> RUNNING),postgres(PULLEDRUNNING),数据(STOPPED-> RUNNING)," 2017-04-05T09:13:11Z [INFO]任务更改事件模块=" TaskEngine" event =" {TaskArn:arn:aws:ecs:eu-west-2:443611395156:task / f510bd3f-5b97-4fbe-af6c-61e037b08a29状态:已停止原因:任务:awseb-ebsBoxer-env-y9jmnnjnnm:3 arn:aws:ecs:eu-west-2:443611395156:task / f510bd3f-5b97-4fbe-af6c-61e037b08a29 ,状态:(STOPPEDSTOPPED)容器:[codebase(STOPPED-> STOPPED),postgres(STOPPED STOPPED),数据(STOPPED-> STOPPED),]}"

如果您需要更多信息,请与我们联系。

1 个答案:

答案 0 :(得分:0)

在我的头上摔了两天后终于找到了它。

之所以发生这种情况,是因为我的数据和代码库容器正在退出,退出代码为“0”。我将命令更改为“tail -f / bin / bash /".

之前:

    {
      "name": "data",
      "image": "id.dkr.ecr.eu-west-2.amazonaws.com/dbdata:latest",
      "essential": false,
      "memory": 512,
      "command" : [
       "/bin/bash"
      ]
    },
    {
      "name": "codebase",
      "image": "id.dkr.ecr.eu-west-2.amazonaws.com/codebase:latest",
      "essential": false,
      "memory": 512,
      "command" : [
       "/bin/bash"
      ]
    }

后:

       {
          "name": "data",
          "image": "id.dkr.ecr.eu-west-2.amazonaws.com/dbdata:latest",
          "essential": false,
          "memory": 512,
          "command": [
            "tail",
            "-f",
            "/bin/bash"
          ]
        },
        {
          "name": "codebase",
          "image": "id.dkr.ecr.eu-west-2.amazonaws.com/codebase:latest",
          "essential": false,
          "memory": 512,
         "command": [
           "tail",
           "-f",
           "/bin/bash"
         ]
        }

我仍然不明白为什么“必要”的旗帜被忽略了!!