July 2017
Intermediate to advanced
374 pages
8h
English
At this point, we need to decide which node should be the leader. Let's select the master node as our Docker manager. So, login into the master machine and execute the following command to initialize this machine to be a leader for the Docker Swarm:
$ docker swarm init --advertise-addr master_ip_address
This command will set the provided host to be the master (leader) and generate a token for the node to connect to. See the following output for your reference:

A few important points to keep in mind: