Little Docker Swarm walkthru

I’ll try to setup a two node docker swarm. quiet easy and done in 10 minutes. i used 2 ubuntu 16.4 64 bit vm’s.

Hostname External IP Internal IP scw-5fd012 212.47.239.153 10.2.37.217 scw-095a80 212.47.240.218 10.2.222.81 i also assume u installed docker.

you need to decide which one will be the manager.

i choose scw-5fd012. on that node i enter a

root@scw-5fd012:~# docker swarm init –advertise-addr 10.2.37.217 Swarm initialized: current node (5lpm87bmugszxrx920k2zmx6k) is now a manager.

To add a worker to this swarm, run the following command:

docker swarm join
–token SWMTKN-1-4mqfnpv0kthd2of2rc7ji9qj5mhlry2o1ktmpofn80hzmopd1d-913n0w2l4x3if7dog5emgw781
10.2.37.217:2377

To add a manager to this swarm, run ‘docker swarm join-token manager’ and follow the instructions. Thats it! the docker swarm is created and scw-5fd012 is the manager.

on scw-095a80 i just enter a

docker swarm join –token SWMTKN-1-4mqfnpv0kthd2of2rc7ji9qj5mhlry2o1ktmpofn80hzmopd1d-913n0w2l4x3if7dog5emgw781 10.2.37.217:2377 and i have my docker swarm set up

on the master i can check if everyhting is working with a simple

root@scw-5fd012:# docker node ls ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS 5lpm87bmugszxrx920k2zmx6k * scw-5fd012 Ready Active Leader f0ogny4uxy5zg956hf8m16eka scw-095a80 Ready Active root@scw-5fd012:#

Tags: docker, linux