为什么在mesos中运行的应用程序没有在consul中注册?

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

我用了一个mesos领事通过马拉松部署了它。作业的json配置为

{
  "id": "/mesos-consul",
  "cmd": null,
  "cpus": 0.1,
  "mem": 256,
  "disk": 0,
  "instances": 1,
  "constraints": [
    [
      "hostname",
      "LIKE",
      "fwvm.*"
    ]
  ],
  "acceptedResourceRoles": [],
  "container": {
    "type": "DOCKER",
    "volumes": [],
    "docker": {
      "image": "ciscocloud/mesos-consul",
      "network": "BRIDGE",
      "portMappings": [],
      "privileged": false,
      "parameters": [],
      "forcePullImage": false
    }
  },
  "portDefinitions": [
    {
      "port": 10000,
      "protocol": "tcp",
      "name": "default",
      "labels": {}
    }
  ],
  "args": [
    "--zk=zk://zookeeper.service.consul:2181/mesos",
    "--log-level=debug",
    "--consul",
    "--refresh=5s"
  ]
}

我用一个服务器和一个客户端运行consur。

consul members info
Node  Address            Status  Type    Build  Protocol  DC
vm1   10.21.10.22:8301  alive   server  0.7.5  2         devops
vm2   10.21.10.25:8301  alive   client  0.7.5  2         devops

迈索斯和马拉松看起来也不错。还是不行
mesos领事日志显示

I0410 14:45:17.917712 18194 exec.cpp:162] Version: 1.2.0
I0410 14:45:17.929821 18200 exec.cpp:237] Executor registered on agent 92704ba7-7324-4e74-a7fd-7b7c642766b2-S0
I0410 14:45:17.932121 18197 docker.cpp:850] Running docker -H unix:///var/run/docker.sock run --cpu-shares 102 --memory 268435456 --env-file /tmp/yDR5nL -v /var/lib/mesos/slaves/92704ba7-7324-4e74-a7fd-7b7c642766b2-S0/frameworks/2679cb7f-1fc2-4e8b-be3c-44f0fb54f618-0000/executors/mesos-consul.36b6d6d3-1dce-11e7-a717-0242b31c8310/runs/6a22da5d-4a33-4d1d-ada7-cd688474e4fc:/mnt/mesos/sandbox --net bridge --label=MESOS_TASK_ID=mesos-consul.36b6d6d3-1dce-11e7-a717-0242b31c8310 --name mesos-92704ba7-7324-4e74-a7fd-7b7c642766b2-S0.6a22da5d-4a33-4d1d-ada7-cd688474e4fc ciscocloud/mesos-consul --zk=zk://http://10.202.11.22:2181/mesos --log-level=debug --consul --refresh=5s
time="2017-04-10T09:15:22Z" level=info msg="Using zookeeper: zk://http://10.202.11.22:2181/mesos" 
time="2017-04-10T09:15:22Z" level=debug msg="Zookeeper address" zk="zk://http://10.202.11.22:2181/mesos"
olhwl3o2

olhwl3o21#

已修复此问题。这是一个与网络有关的问题。alpine linux试图用
名称服务器127.0.0.1
换成了我们的dns服务器。

相关问题