正在运行的实例的IP未传播

时间:2017-10-18 12:25:58

标签: mesos marathon traefik

我有一个正在运行的Mesos / Marathon集群,但正在运行的实例的ip不会传播到Marathon-UI或traefik代理。

我的mesos设置:

ExecStart=/bin/bash -c "/usr/sbin/mesos-slave \
            --hostname=$(/usr/bin/hostname) \
            --work_dir=/var/lib/mesos \
            --master=zk://xxx.net:2181,yyy:2181,zzz:2181/mesos \
            --log_dir=/var/log/mesos \
            --executor_registration_timeout=10mins \
            --containerizers=docker,mesos \
            --docker=$(which docker) \
            --ip=$(ifconfig eth0 | grep -oP 'inet \K\S+')"

我的treafik conf:

logLevel = "INFO"
[web]
address = ":8088"
[marathon]
endpoint = "http://xxx:8080"
watch = true
domain = "xxx"
exposedByDefault = true
groupsAsSubDomains = true
forceTaskHostname = true

[accessLog]

enter image description here enter image description here

更新 应用程序定义是:

{
  "id": "/web",
  "cmd": null,
  "cpus": 1,
  "mem": 64,
  "disk": 0,
  "instances": 1,
  "acceptedResourceRoles": [
    "*"
  ],
  "container": {
    "type": "DOCKER",
    "volumes": [],
    "docker": {
      "image": "ldaume/caddy",
      "network": "BRIDGE",
      "portMappings": [
        {
          "containerPort": 2015,
          "hostPort": 0,
          "servicePort": 10001,
          "protocol": "tcp",
          "labels": {}
        }
      ],
      "privileged": false,
      "parameters": [],
      "forcePullImage": false
    }
  },
  "portDefinitions": [
    {
      "port": 10001,
      "protocol": "tcp",
      "labels": {}
    }
  ]
}

如果我使用具有给定端口的Marathon DNS,则可以访问该应用程序。

1 个答案:

答案 0 :(得分:0)

我和你有相同的设置,我的报告正确。我正在使用1.4 traefik。 Traefik配置非常简单:

################################################################
# Global configuration
################################################################

defaultEntryPoints = ["http"]


################################################################
# Web configuration backend
################################################################

[web]
  address = ":8081"

################################################################
# Marathon configuration backend
################################################################


[marathon]
  endpoint = "http://172.31.xx.xx:8080"

  domain = "marathon.localhost"

  watch = true

...... 这是使用docker容器的AWS设置,其中endpoint是内部VPC IP,而不是外部AWS IP。