上的dcos连接被拒绝

wdebmtf2  于 2021-06-26  发布在  Mesos
关注(0)|答案(1)|浏览(352)

我已经启动并运行了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": {}
    }
  ]
}

有人能帮忙吗。

sd2nnvve

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
从集群外部

从集群内部

core@ip-10-0-4-343 ~ $ curl  http://marathon-lb.marathon.mesos:10000/
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>

相关问题