当我将一个docker容器作为马拉松作业运行时,它会在active mesos slave系统中创建一个docker容器.当暂停或销毁docker作业时,我期望马拉松应该删除不再需要的docker容器.但容器不会被删除.每次马拉松重启docker容器作业时我都必须手动删除它们.
{
"id": "pga-docker","cmd":"sh pga-setup.sh","cpus": 0.5,"mem": 1024.0,"container": {
"type": "DOCKER","docker": {
"image": "pga:test","parameters": [
{ "key": "env","value": "SERVER_HOST=value" },{ "key": "env","value": "SERVER_PORT=value" }
],"network": "BRIDGE","portMappings": [
{ "containerPort": 80,"hostPort": 0}
]
}
}
}
最佳答案
Marathon将重新启动失败的docker容器,以便您拥有所请求的实例数.可能是您看到未被Mesos清理的已停止/未通过的容器.这可能与Mesos延迟容器清理直到GC的事实有关.
见https://issues.apache.org/jira/browse/MESOS-1656
见https://issues.apache.org/jira/browse/MESOS-1656