I'd like to set up a production HA Docker Swarm cluster.

Docker Swarm needs a Key Value store as a precondition, consul in this case.

Now I'm asking what a clever setup would be:

  • Consul should run in Docker containers
  • Consul must be HA and automatically scaleable
  • Consul containers should be managed with Docker Swarm (this would need consul running though)


  • Running consul on the host is not an option
  • Having to manage consul containers manually is not an option
  • Docker Swarm with a Docker Hub token is not an option


Any ideas how this chicken or the egg problem can be solved in a clean and reliable manner for efficient operation?

Multiple swarm instances would certainly look like a reasonable approach but how to setup the initial swarm without consul and swarm? Thanks.

  • 2
    Docker Swarm is "still in its infancy" as what little documentation it has says. And large parts of that documentation appear to not yet be written, including what you are looking for. I don't think this is production ready. – Michael Hampton Jan 10 '16 at 20:40
  • Thanks for your comment. Docker claims it is production ready. I'm not that naive to not understand that this is more of a marketing production ready and you certainly have a point being skeptic and pointing out the lack of documentation as a proof. Nevertheless I hoped that somebody already encountered and solved this very fundamental question in a proper way. I hope there's already more existing than just the hype... – binaryanomaly Jan 10 '16 at 20:55
  • There's always been a lot more hype than reality surrounding Docker. I didn't even seriously consider Swarm for a production anything; at the moment Kubernetes and OpenShift v3 (which is based on Kubernetes!) are the only things that I am aware of that are ready to go. – Michael Hampton Jan 10 '16 at 21:06
  • Regarding the hype that is certainly the case. But with Kubernetes still being only single master I would also not consider it being fully battle tested and rely on it. Mesos might be but it feels too heavy and not optimal for lighter setups. But even for setting up Kubernetes I would prefer to deploy it in containers and for that basic setup swarm could be a nice minimalistic solution since it doesn't need much more than a key value store. Since already the very basic set up of swarm in containers currently appears as not properly solved it may take some more time though. – binaryanomaly Jan 10 '16 at 21:33
  • Multiple masters is one reason I went with Openshift (not to mention multiple etcds). – Michael Hampton Jan 10 '16 at 21:39

Jacob Blain Christen has a nice article about this very problem. In short: start the docker daemon with a reference to the not yet existing consul cluster, then start consul via docker. Citation:

Fortunately, the Docker daemon will happily retry to connect to the cluster-store aka the KVS every so often, this gives us time to underlay it via Docker Compose.

Hope this helps.

  • Thanks. Looks like that is the best of the available not so good solutions atm. – binaryanomaly Mar 19 '16 at 15:55

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.