【问题标题】:DCOS Minuteman VIP (with IP and port) is not reachableDCOS Minuteman VIP(带 IP 和端口)无法访问
【发布时间】:2017-12-01 18:44:45
【问题描述】:

尝试设置 VIP(不基于 IP 和端口的名称),如 the documentation 中所述

也称为the Marathon examples

在此处编写示例 json(与上面链接中的相同)

{
  "id": "/server",
  "cmd": "python -m SimpleHTTPServer 80",
  "cpus": 1,
  "mem": 128,
  "disk": 0,
  "instances": 1,
  "container": {
    "docker": {
      "image": "python:2.7-alpine",
      "network": "BRIDGE",
      "portMappings": [
        {
          "containerPort": 80,
          "protocol": "tcp",
          "name": "http",
          "labels": {
            "VIP_0": "192.168.0.100:80"
          }
        }
      ]
    },
    "type": "DOCKER"
  }
}

但根据文档中的原始期望,IP 192.168.0.100:80 应该可以从集群的节点访问。但显然这对我不起作用..一个简单的 Curl 失败..我需要访问这个应用程序可以从其他不知道 mesos-dns 的进程访问。

【问题讨论】:

  • 您运行的是哪个 DC/OS 版本?首先,您引用的是旧的 1.7 文档。其次,我刚刚尝试了 1.10 集群,它对我有用 curl 192.168.0.100:80 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html>
  • 我们目前处于 1.8.7 版本中。您能否确认您是否能够从集群中的终端而不是在任何其他马拉松应用程序中进行 curl...?
  • 我可以从主节点卷曲它,见上文

标签: mesos marathon dcos


【解决方案1】:

您使用的配置需要USER 网络,只需将 IP 地址替换为名称即可:

  "portMappings": [
        {
          "containerPort": 80,
          "protocol": "tcp",
          "name": "http",
          "labels": {
            "VIP_0": "web-app:80"
          }
        }
      ]

然后应该可以通过web-app.marathon.l4lb.thisdcos.directory:80访问它

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-25
    • 2015-05-12
    • 1970-01-01
    • 1970-01-01
    • 2018-09-26
    • 2015-01-12
    相关资源
    最近更新 更多