Setup machines for Docker
Now that vision and technology has been defined I start with setting up an environment for my project.
Setup the nodes for the cluster
Docker swarm needs at least three nodes (one master and two workers) in order to run.
These could be virtual machines or physical machines. You could even use Docker in Docker DinD to create the nodes of the swarm cluster.
There is a great post on how to do that here.
Since I would like to use the same setup for Kubernetes later (and that does not work with DinD) and I do not have VMs at hand, I decided to dig out some of my old hardware and set up a cluster.
The physical machines
So I installed Ubuntu and docker on
- an old laptop
- the old pc of my parents
- a refurbished dell workstation
- and on my own computer (dual boot)
I assigned IP addresses and hostnames manually. Although next time I would use Ansible instead. Since setting up four machines only is quiet a boring tasks.
Here is what the network layout looks like:
192.168.0.1 silentmaxx.jeeatwork.com silentmaxx
192.168.0.2 corsair.jeeatwork.com corsair
192.168.0.3 thinkpad.jeeatwork.com thinkpad
If you wonder about the curious names: I took some kind of label that was visible on the machines so that I could identify them easily.
Docker installation is straight forward and described in detail here. Note that depending on the version to use the repos might be different ones.
At the end I added docker to start up at boot time.
That finished my setup. Next: Try the swarm mode
With the machines up and running it’s time to do some serious swarming. So the next steps are:
- Technology: Try a docker swarm tutorial
- Application: Select a specific feature