运行docker集装箱作为马拉松的任务

我在本地系统上安装了mesos和marathon。 此外,我有我的系统上运行docker引擎,当我这样做, 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 

现在,通过Marathon UI,我正在尝试创build一个应用程序,在完成https://mesosphere.github.io/marathon/docs/native-docker-private-registry.html文档中的所有步骤之后,当我最终创build应用程序时,间歇性地部署和等待状态会有所不同,最后会显示延迟。 我从来没有在跑步阶段得到它。 我试图找出我的机器上的日志,但我无法理解他们看到他们的音量。

我的应用程序的JSONconfiguration如下:

 { "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,应该会发生什么事是应用程序应该自动从我的本地回购拉这个图像,并最终部署在机器上。 我还应该为我的应用程序创build一个任务,因为我没有专门做任何任务? 如果是的话,我不会先创build一个应用程序,然后添加任务吗?

另外,我像这样重新启动了mesos slave: sudo ./bin/mesos-slave.sh --master=127.0.0.1:5050 --work_dir=/var/lib/mesos --containerizers=docker,mesos --executor_registration_timeout=5mins

另外,我尝试在我的本地主机上URI: file///etc/docker.repo.tar.gz repo的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 。 因此,我认为这是我出错的地方。

编辑:应用程序的马拉松日志build议:

 [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 scheduler-c27b723e-e9d3-428a-b7d3-c8c184b1ed7c@172.26.35.124: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 scheduler-c27b723e-e9d3-428a-b7d3-c8c184b1ed7c@172.26.35.124: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 master@172.26.35.124: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 

从JSON模式的angular度来看,JSON似乎很好。 TBH,如果你想在Mesos上testing正在运行的容器, cmd属性的内容并没有什么意义。

我甚至认为你使用的命令将无法工作,在应用程序上下文中执行Docker …

请使用像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 }] } 

检查整体function。 如果nginx ,请将nginx映像标记并推送到本地registry中,并通过uris凭证传递方法和本地映像名称尝试使用它。