Search code examples
dockerdocker-swarm

Can you explain roles of swarm machine?


In http://docs.docker.com/swarm/install-w-machine/

There are four machines:

  1. Local, where swarm create will run
  2. swarm-master
  3. swarm-agent-00
  4. swarm-agent-01

My understanding is swarm-master will control agents, but what is Local used for?


Solution

  • It is for generating the discovery token using the Docker Swarm image.
    That token is used when creating the swarm master.

    This discovery service associates a token with instances of the Docker Daemon running on each node. Other discovery service backends such as etcd, consul, and zookeeper are available.

    So the "local" machine is there to make sure the swarm manager discovers nodes. Its functions are:

    • register: register a new node
    • watch: callback method for the swarm manager
    • fetch: fetch the list of entries

    See this introduction:

    architecture