我已经启动并运行了DCO。我创建了一个服务,我可以通过ip:端口访问它,但是当我尝试用marathonlb做同样的事情时,我就是无法访问它。我试过卷发http://marathon-lb.marathon.mesos:10000/10000是端口号,我仍然无法连接。
这是我的json服务:
{
"id": "/nginx-external",
"cmd": null,
"cpus": 0.1,
"mem": 65,
"disk": 0,
"instances": 1,
"acceptedResourceRoles": [],
"container": {
"type": "DOCKER",
"volumes": [],
"docker": {
"image": "nginx:1.7.7",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 80,
"hostPort": 2000,
"servicePort": 10000,
"protocol": "tcp",
"labels": {}
}
],
"privileged": false,
"parameters": [],
"forcePullImage": true
}
},
"healthChecks": [
{
"gracePeriodSeconds": 10,
"intervalSeconds": 2,
"timeoutSeconds": 10,
"maxConsecutiveFailures": 10,
"portIndex": 0,
"path": "/",
"protocol": "HTTP",
"ignoreHttp1xx": false
}
],
"labels": {
"HAPROXY_GROUP": "external"
},
"portDefinitions": [
{
"port": 10000,
"protocol": "tcp",
"name": "default",
"labels": {}
}
]
}
有人能帮忙吗。
1条答案
按热度按时间sd2nnvve1#
两者都通过使用从集群外部访问它
public-ip:10000
(请参阅此处查找公共ip)并从集群内部使用curl http://marathon-lb.marathon.mesos:10000/
干得不错。注意,您需要安装marathon lb(dcos package install marathon-lb
)以及marathon-lb.marathon.mesos
只能从群集中解析。为了调试marathon lb问题,我通常首先检查haproxy统计:https://dcos.io/docs/1.9/networking/marathon-lb/marathon-lb-advanced-tutorial/#deploy-一个外部负载平衡器与马拉松lb
从集群外部
从集群内部