Creating a Docker Swarm Cluster (Azure Swarm)
Procedure
-
Navigate to the following folder:
docker-deploy/azure/swarm/manifest-azure-swarm
- Ensure that all machines on the network can communicate with each other, and the ports 2376, 2377, 7946 are open on each host.
- ssh into the machine that you will run as Swarm Manager.
-
Start the Swarm Manager using the following command:
docker swarm init --advertise-addr <Manager Private IP>
For example:
docker swarm init --advertise-addr 10.127.135.61
Example output:
Swarm initialized: current node (1qqfygb5po6r0y8vqjjceu6pj) is now a manager. To add a worker to this swarm, run the following command: docker swarm join --token SWMTKN-1-5ef0r0rlhqrgw5olehorwrsmn0cz83ygnkfex8lzeixndv4av3-at5f983kuwyyiyko6hls412cu 10.127.135.61:2377 To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
-
ssh into the other nodes and run the following
docker swarm join command (using output from step 4):
docker swarm join --token <TOKEN> <Manger Private IP>:2377 --advertise-addr <Node Private IP>
For example:
docker swarm join --token SWMTKN-1-0xuxeo975vwq2dprcy77loazmyqqqr9muzw29yh0xvopq8398z-3zo8r2hb6o3xw51cyogz3z0k6 10.107.138.60:2377 --advertise-addr 10.107.138.62
- Verify that the cluster is created successfully by running the following command on the manager. Status should be Ready for all the nodes.
-
Login to the Docker Registry.
docker login <registry host> -u <user> -p <password>
Make sure the login is successful before performing the next step.
-
Create an Overlay network "ml5" for the containers network by running the following command on the manager node:
docker network create -d overlay --attachable ml5
Copyright © Cloud Software Group, Inc. All rights reserved.