mantl/mesos-consul

Service found. Not registering.

Closed this issue · 2 comments

None of the services I launch ever get registered with consul. Here are the logs:

time="2015-10-14T16:21:04Z" level=info msg="Running parseState"
time="2015-10-14T16:21:04Z" level=debug msg="Running RegisterHosts"
time="2015-10-14T16:21:04Z" level=info msg="Host found. Comparing tags: ([agent], [agent])"
time="2015-10-14T16:21:04Z" level=info msg="Host found. Comparing tags: ([leader master], [leader master])"
time="2015-10-14T16:21:04Z" level=debug msg="Done running RegisterHosts"
time="2015-10-14T16:21:04Z" level=debug msg="Service found. Not registering: mesos-consul:127.0.0.1:service1:13254"
time="2015-10-14T16:21:04Z" level=debug msg="Service found. Not registering: mesos-consul:127.0.0.1:service2:49394"
time="2015-10-14T16:21:04Z" level=debug msg="Service found. Not registering: mesos-consul:127.0.0.1:service3:18796"

I'm launching with this command:

docker run -i ciscocloud/mesos-consul \
   --zk=zk://zk-1.service.consul:2181/mesos \
   --refresh=15s \
   --log-level=debug \
   --consul

Try running adding --net=host to your docker command. mesos-consul uses the address of the mesos slave/agent to connect to the Consul agent. In your case, the mesos slave/agent is 127.0.0.1 and the docker container can't connect to it.

One issue that I have to fix is that the service is being added to the serviceCache even if the consul registration fails.

Yes. That does fix it. Thanks.