Docker Community Forums

Share and learn in the Docker community.

Can Docker Compose build a ZooKeeper Discovery service for Swarm?


(Joeg) #1

First off, newbie here, so please be kind if this is a lame question! Also, please take pains to be thorough in any answers as I (and others) may not quite be ready for the leap to hyperspace!

Found this Five Server ZooKeeper Example . It uses Docker Compose to deploy a 5 host ensemble.

My questions are:

  1. Can that ZooKeeper instance subsequently be used as a Discovery Service in Swarm? If so, how would that be accomplished (assuming only the five nodes for the swarm)?
  2. Related to the first question - the Docker Documentation says that Compose and Swarm aim to have full integration… meaning you can point a Compose app at a Swarm Cluster. But how much of the Swarm Cluster can Compose compose? That is, is it possible to have Compose also build the swarm cluster it will subsequently use?

(Nathan Le Claire) #2

ZooKeeper is an available backend for the “legacy Swarm” ( but as of 1.12.0 orchestration and discovery features are built in to a new Docker-native “swarm mode”. You should look into that, you may not need ZK at all.