mantl / mesos-consul

Mesos to Consul bridge for service discovery
Apache License 2.0
338 stars 95 forks source link

Run several mesos-consul in parallel #110

Closed chaen closed 7 years ago

chaen commented 7 years ago

Hi,

I couldn't find in the documentation whether it is ok to run several mesos-consul in parallel ? is there no risk of duplicated services/splitbrain or whatever ?

Thanks Chris

stevendborrelli commented 7 years ago

You probably should only run one process, as it connects to the consul daemons on each system to register them. There's really not a big risk of split brain in the process itself, it queries mesos and then registers the tasks on each consul node.

chaen commented 7 years ago

Yeah, but then this becomes a single point of failure :-/ Any way around that ?

stevendborrelli commented 7 years ago

We usually have run it via Marathon, so that it gets restarted if it dies. If you want stronger HA, maybe look at implementing a lock among multiple mesos-consul process via consul locks.

chaen commented 7 years ago

Well that is exactly what I do as well :-) I was just worried of the bootstrapping problem in case of failure, since I generate mesos' whitelist from that. Thanks !

mnp commented 7 years ago

We came to the same conclusion here. Run one, and let Marathon deal with restarting it. If it dies, you might wait a few seconds before a replacement starts up, which is okay because the poll cycle is a minute anyway. We thought about multiple instances and decided against it.