Allow the consul addr to be configured
mindscratch opened this issue · 8 comments
When I try to run mesos-consul I'm unable to specify the location of consul, it seems to want to connect to consul as if it's running on a mesos master node. It would be great if I could specify consul-addr 192.168.1.2
, looks like consul-port
is already supported.
In order to get a service registered with the correct node in Consul's catalog, it has to be registered with an agent running on the same node as the service. Otherwise all of the services are listed as being on the consul master node and a failed service check affects the consul server instead of the node the service is running on.
@ChrisAubuchon that explains it, I was just testing and didn't have agents running on all hosts which had mesos tasks. Thanks.
It would be really helpful if this was spelled out somewhere. Adding a paragraph or two on how this should be deployed would be very helpful.
So if i have a mesos cluster of say 300 nodes i need to setup consul on every single one? This seems like an insane waste to me.
This is part of the consul design. It is expected to run an agent on every node so that registrations and health checks are performed locally.
just put it in your slave chef/puppet/etc. script that creates the node. It actually simplifies things since you can count on it being there, and helps with multi-data-center functions.
True, seems to be a little bit of an issue bridging the gap between using consul with docker/mesos/marathon vs just using it in a VM which is incredibly simple.
The issue is with how Consul registers services. If you have a service running on Mesos agent A and you register that service with a central Consul server, the Consul server becomes the "owner" of the service. So if the consul server is taken out of service, then the service that is running on the is marked as unavailable. If you try to specify the mesos agent as the "owner" while registering at the Consul server, the created service is cleaned up by anti-entropy.