【问题标题】:Consul UI and service-discovery doesn't update servicesConsul UI 和服务发现不更新服务
【发布时间】:2016-10-23 00:56:04
【问题描述】:

当服务改变时,Consul 用户界面不会更新服务。问题是我启动了一个 example.json 到 marathon,它在 consul 用户界面中显示为服务,但是当我从 marathon 中删除该应用程序时,它并没有从 consul UI 中删除它。 会是什么?

【问题讨论】:

  • 如何在 Consul 中注册服务? Be design consul 不会删除不健康的服务。

标签: mesos marathon service-discovery consul dnsmasq


【解决方案1】:

我使用 ciscocloud/mesos-consul 向 consul 注册 mesos 应用,效果很好

 {
  "id": "/mesos-consul",
  "cmd": null,
  "cpus": 0.33,
  "mem": 128,
  "disk": 0,
  "instances": 1,
  "container": {
    "type": "DOCKER",
    "volumes": [],
    "docker": {
      "image": "ciscocloud/mesos-consul",
      "network": "BRIDGE",
      "portMappings": [
        {
          "containerPort": 0,
          "hostPort": 0,
          "servicePort": 10004,
          "protocol": "tcp",
          "labels": {}
        }
      ],
      "privileged": false,
      "parameters": [],
      "forcePullImage": false
    }
  },
  "portDefinitions": [
    {
      "port": 10004,
      "protocol": "tcp",
      "labels": {}
    }
  ],
  "args": [
    "--zk=zk://zookeeper-hostname:2181/mesos",
    "--mesos-ip-order=mesos",
    "--log-level=err",
    "--refresh=1s"
  ]
}

【讨论】:

  • 根据this comment,CiscoCloud 团队从 Consul 搬到了 Traefik,所以也许你有兴趣搬到 allegro/marathon-consul。如果您只需要支持 Marathon 服务,它可能会更好,因为它使用 Marathon 事件,并提供更多配置选项 + 健康检查。
猜你喜欢
  • 2020-07-30
  • 2018-03-07
  • 2017-08-16
  • 2017-12-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-07-01
相关资源
最近更新 更多