2016-09-26 42 views
1

我在本地系统上安装了mesos和marathon。另外,我有搬运工引擎我的系统上运行,而当我这样做,sudo docker images,我得到以下,将码头集装箱作为马拉松的任务

REPOSITORY             TAG     IMAGE ID   CREATED    SIZE 
myrepo/hello            latest    b7ce0084dbaf  4 weeks ago   330.3 MB 
fluent/new             latest    adc4b7b4b0eb  4 weeks ago   1.589 GB 
<none>              <none>    3a87799875ed  4 weeks ago   1.589 GB 
<none>              <none>    16a573cd3b85  4 weeks ago   330.3 MB 
769348183957.dkr.ecr.us-east-1.amazonaws.com/ruby   2.1.10    77bf121d484e  8 weeks ago   1.535 GB 
769348183957.dkr.ecr.us-east-1.amazonaws.com/centos-base 7     9ab68a0dd16a  10 weeks ago  330.3 MB 
hello-world            latest    c54a2cc56cbb  12 weeks ago  1.848 kB 
docker/whalesay           latest    6b362a9f73eb  16 months ago  247 MB 

现在,通过马拉松UI,我试图让一个应用程序,并会尽一切后在https://mesosphere.github.io/marathon/docs/native-docker-private-registry.html文档中的步骤,当我最终创建应用程序时,它的状态因部署和等待间歇性而异,最终显示延迟。我从来没有在跑步阶段得到它。我试图弄清楚我的机器上的日志,但我无法理解他们看到他们的音量。

的应用我的JSON的配置如下:

{ 
    "id": "/123", 
    "cmd": "sudo docker run -itd 9ab68a0dd16a /bin/bash", 
    "cpus": 1, 
    "mem": 128, 
    "disk": 200, 
    "instances": 1, 
    "container": { 
    "docker": { 
     "image": "769348183957.dkr.ecr.us-east-1.amazonaws.com/centos-base", 
     "network": "HOST", 
     "forcePullImage": true 
    }, 
    "type": "DOCKER" 
    } 
} 

我错过了什么? AFAIK,应该会发生什么,应用程序应该自动从我的本地回购中拉出这个图像,并最终部署在机器上。我是否也应该为我的应用程序创建任务,因为我没有专门做任何任务?如果是的话,我不需要先创建一个应用程序,然后添加任务吗?

而且,我重新启动mesos奴是这样的:sudo ./bin/mesos-slave.sh --master=127.0.0.1:5050 --work_dir=/var/lib/mesos --containerizers=docker,mesos --executor_registration_timeout=5mins

而且,我试图使我的本地主机泊坞窗回购的tar.gz文件并将其复制到/ etc并通过了URI: file///etc/docker.repo.tar.gz

我哪里错了?在马拉松日志中,我可以看到None of the enabled containerizers (mesos) could create a container for the provided TaskInfo/ExecutorInfo message。因此,我认为这是我出错的地方。

编辑:马拉松日志应用建议:

[2016-09-26 12:29:30,418] INFO Task launch for 'task [nginx.c59c7403-83b6-11e6-a834-0a0027000000]' was accepted. 0 tasksToLaunch, 0 in flight, 1 confirmed. not backing off (mesosphere.marathon.core.launchqueue.impl.AppTaskLauncherActor:marathon-akka.actor.default-dispatcher-8) 
I0926 12:29:30.418325 90841088 master.cpp:3104] Processing ACCEPT call for offers: [ d165ac5e-93dc-4b7b-bf36-071ce75aa44d-O17 ] on slave d165ac5e-93dc-4b7b-bf36-071ce75aa44d-S0 at slave(1)@172.26.35.124:63837 (172.26.35.124) for framework fa8c0ef7-651b-41c2-8f1c-c24057bcfb58-0000 (marathon) at [email protected]:63837 
I0926 12:29:30.419334 90841088 master.hpp:177] Adding task nginx.c59c7403-83b6-11e6-a834-0a0027000000 with resources cpus(*):0.1; mem(*):256; ports(*):[31835-31835] on slave d165ac5e-93dc-4b7b-bf36-071ce75aa44d-S0 (172.26.35.124) 
I0926 12:29:30.419400 90841088 master.cpp:3589] Launching task nginx.c59c7403-83b6-11e6-a834-0a0027000000 of framework fa8c0ef7-651b-41c2-8f1c-c24057bcfb58-0000 (marathon) at [email protected]:63837 with resources cpus(*):0.1; mem(*):256; ports(*):[31835-31835] on slave d165ac5e-93dc-4b7b-bf36-071ce75aa44d-S0 at slave(1)@172.26.35.124:63837 (172.26.35.124) 
I0926 12:29:30.419661 89767936 slave.cpp:1361] Got assigned task nginx.c59c7403-83b6-11e6-a834-0a0027000000 for framework fa8c0ef7-651b-41c2-8f1c-c24057bcfb58-0000 
I0926 12:29:30.421689 90304512 gc.cpp:83] Unscheduling '/tmp/mesos/0/slaves/d165ac5e-93dc-4b7b-bf36-071ce75aa44d-S0/frameworks/fa8c0ef7-651b-41c2-8f1c-c24057bcfb58-0000' from gc 
I0926 12:29:30.422006 89767936 gc.cpp:83] Unscheduling '/tmp/mesos/0/meta/slaves/d165ac5e-93dc-4b7b-bf36-071ce75aa44d-S0/frameworks/fa8c0ef7-651b-41c2-8f1c-c24057bcfb58-0000' from gc 
I0926 12:29:30.422173 88158208 slave.cpp:1480] Launching task nginx.c59c7403-83b6-11e6-a834-0a0027000000 for framework fa8c0ef7-651b-41c2-8f1c-c24057bcfb58-0000 
I0926 12:29:30.422904 88158208 paths.cpp:528] Trying to chown '/tmp/mesos/0/slaves/d165ac5e-93dc-4b7b-bf36-071ce75aa44d-S0/frameworks/fa8c0ef7-651b-41c2-8f1c-c24057bcfb58-0000/executors/nginx.c59c7403-83b6-11e6-a834-0a0027000000/runs/0548c84c-40ad-40cd-bbd8-b1330e66f348' to user 'bhjain' 
I0926 12:29:30.445124 88158208 slave.cpp:5352] Launching executor nginx.c59c7403-83b6-11e6-a834-0a0027000000 of framework fa8c0ef7-651b-41c2-8f1c-c24057bcfb58-0000 with resources cpus(*):0.1; mem(*):32 in work directory '/tmp/mesos/0/slaves/d165ac5e-93dc-4b7b-bf36-071ce75aa44d-S0/frameworks/fa8c0ef7-651b-41c2-8f1c-c24057bcfb58-0000/executors/nginx.c59c7403-83b6-11e6-a834-0a0027000000/runs/0548c84c-40ad-40cd-bbd8-b1330e66f348' 
I0926 12:29:30.446513 88158208 slave.cpp:1698] Queuing task 'nginx.c59c7403-83b6-11e6-a834-0a0027000000' for executor 'nginx.c59c7403-83b6-11e6-a834-0a0027000000' of framework fa8c0ef7-651b-41c2-8f1c-c24057bcfb58-0000 
E0926 12:29:30.446702 88158208 slave.cpp:3784] Container '0548c84c-40ad-40cd-bbd8-b1330e66f348' for executor 'nginx.c59c7403-83b6-11e6-a834-0a0027000000' of framework fa8c0ef7-651b-41c2-8f1c-c24057bcfb58-0000 failed to start: **None of the enabled containerizers (mesos) could create a container for the provided TaskInfo/ExecutorInfo message** 
E0926 12:29:30.446846 90841088 slave.cpp:3855] Termination of executor 'nginx.c59c7403-83b6-11e6-a834-0a0027000000' of framework fa8c0ef7-651b-41c2-8f1c-c24057bcfb58-0000 failed: Unknown container: 0548c84c-40ad-40cd-bbd8-b1330e66f348 
I0926 12:29:30.453965 90841088 slave.cpp:3012] Handling status update TASK_FAILED (UUID: 90717092-98c0-4eab-9967-f43e005159b5) for task nginx.c59c7403-83b6-11e6-a834-0a0027000000 of framework fa8c0ef7-651b-41c2-8f1c-c24057bcfb58-0000 from @0.0.0.0:0 
W0926 12:29:30.454391 91914240 containerizer.cpp:1295] Ignoring update for unknown container: 0548c84c-40ad-40cd-bbd8-b1330e66f348 
I0926 12:29:30.454927 91377664 status_update_manager.cpp:320] Received status update TASK_FAILED (UUID: 90717092-98c0-4eab-9967-f43e005159b5) for task nginx.c59c7403-83b6-11e6-a834-0a0027000000 of framework fa8c0ef7-651b-41c2-8f1c-c24057bcfb58-0000 
I0926 12:29:30.455751 91377664 status_update_manager.cpp:824] Checkpointing UPDATE for status update TASK_FAILED (UUID: 90717092-98c0-4eab-9967-f43e005159b5) for task nginx.c59c7403-83b6-11e6-a834-0a0027000000 of framework fa8c0ef7-651b-41c2-8f1c-c24057bcfb58-0000 
I0926 12:29:30.456254 90304512 slave.cpp:3410] Forwarding the update TASK_FAILED (UUID: 90717092-98c0-4eab-9967-f43e005159b5) for task nginx.c59c7403-83b6-11e6-a834-0a0027000000 of framework fa8c0ef7-651b-41c2-8f1c-c24057bcfb58-0000 to [email protected]:63837 
I0926 12:29:30.456456 91377664 master.cpp:4763] Status update TASK_FAILED (UUID: 90717092-98c0-4eab-9967-f43e005159b5) for task nginx.c59c7403-83b6-11e6-a834-0a0027000000 of framework fa8c0ef7-651b-41c2 
+1

你能否在这个问题上修复应用定义JSON?另外,您是否使用基础Docker镜像?你需要一个在前台运行的应用程序。如果你运行一个标准的nginx镜像(来自Docker Hub),会发生什么? – Tobi

+0

@Tobi,哦,我的坏,我会做。 –

+0

我的意思是粘贴一个“真正的”JSON ... – Tobi

回答

0

的JSON似乎罚款从JSON模式的观点。 TBH,cmd属性内容如果要在Mesos上测试正在运行的容器,则没有任何意义。

我甚至觉得你使用该命令将无法正常工作,在应用程序上下文中执行多克......

请使用标准的图像像nginx这样的:

{ 
    "id": "nginx", 
    "container": { 
    "type": "DOCKER", 
    "docker": { 
     "image": "nginx", 
     "network": "BRIDGE", 
     "portMappings": [ 
     { "hostPort": 0, "containerPort": 80 } 
     ], 
     "forcePullImage":true 
    } 
    }, 
    "instances": 1, 
    "cpus": 0.1, 
    "mem": 256, 
    "healthChecks": [{ 
     "protocol": "HTTP", 
     "path": "/", 
     "portIndex": 0, 
     "timeoutSeconds": 10, 
     "gracePeriodSeconds": 10, 
     "intervalSeconds": 2, 
     "maxConsecutiveFailures": 10 
    }] 
} 

检查整体功能。如果可行,请将nginx图像标记并推送到本地注册表中,并通过uris凭证传递方法和本地图像名称尝试使用它。

+0

我仍然面临同样的问题,当我使用这个JSON。检查我原来的帖子中的编辑。你认为这可能是配置问题吗? –

+0

您可以在从站上手动启动Docker容器吗?'**没有启用的容器(mesos)可以为提供的TaskInfo/ExecutorInfo消息创建一个容器**错误提示通过Docker – Tobi

+0

启动容器的问题,因为从属服务器在本地运行,是的,当我运行一个图像,我可以在运行mesos slave的机器上运行容器。 –