How to Build a Raspberry Pi Cluster with Docker
Raspberry Pi

Although the Royal Spanish Academy prefers words like group or bunch, those of us who have spent years in the world of computing lean toward the classic "cluster" to describe a series of interconnected computers that behave as if they were a single one. If you have ever thought about creating your own home cluster, maybe you want to start with a kind of "scale model" using several Raspberry Pi and the Docker platform.

Why Build a Raspberry Pi Cluster?

Let's set aside arcade machines, emulators, console transformations and DIY computers. The Raspberry Pi can be applied to much more complex projects, such as the creation of supercomputers and the occasional cluster. The first advantage is undoubtedly the low cost of the Raspberry Pi. A simple web search will lead us to ideas based on the Raspberry Pi Zero, but it has become very difficult to obtain the little brother in large numbers at five dollars. The best option is to invest some cash in 7 or 8 of the most affordable Raspberry Pi we can get, and work from there. The second advantage I want to mention is learning. Personally, I never needed to configure a cluster (I've seen a couple running), but if I wanted to "get my feet wet" on the subject, I reckon I'd start by exploring this route.

A Docker Swarm Tutorial

The tutorial published by Alex Ellis on YouTube teaches us how to configure several Raspberry Pi (seven in this case, adding up to a total of 28 cores because it uses the quad-core RPi 2b) using the so-called "Swarm Mode" of the Docker platform. One of the many phrases used to describe Docker is "container manager". Developers can create, run, and test their own applications in an isolated environment, but instead of virtualizing hardware like VirtualBox would, Docker's role is more aligned with that of an "operating system".

The video lasts about 17 minutes, but we also find additional information on Alex Ellis's blog, including instructions for installing Docker 1.12 on Raspbian Lite, which as always should be preloaded on the memory card of each Raspberry Pi. In a few words, you have to get your hands a little dirty, and not be afraid of the Linux console. Remember: The plan is to learn and experiment.

Source: