In this example, there are 3 servers with Docker installed on it. If docker is not installed, you can see the installation here.
There will be one manager and two workers:
Master – manager (IP: 184.108.40.206)
Slave_1 – worker (IP: 220.127.116.11)
Slave_2 – worker (IP: 18.104.22.168)
Required ports for Docker Swarm to work: 2376 and 2377 (TCP). Make sure that the swarm participants are allowed to interact.
Creating Docker Swarm
On the Master server, do the following:
docker swarm init --advertise-addr 22.214.171.124
We get a message like:
Swarm initialized: current node (ssmj2qyqxejd72p6sa9jinnza) is now a manager.
To add a worker to this swarm, run the following command:
docker swarm join \
--token SWMTKN-1-3qg9vovt2mxyfu1dfj2nocmkzd3i351z1z0aapd9jxxu7mafff-93r77xv8mrqsgfkf9nei902zk \
To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
Swarm is created and there is one manager in it. Information on the swarm can be viewed with the command:
Continue reading "Docker Swarm over TLS"