Raspberry Pi Cluster

This is a cluster of 5 Raspberry Pi 2 Model B computers I made in order to test some popular cluster configurations like Docker Swarm, Kubernetes, Hadoop, Node.js, Rabbit MQ and so on…

Raspberry Pi Cluster

I presented this cluster on a local meet up when I was talking about setting up a Docker Swarm Cluster.

57b02facbb7801a35fbac68fb89022ce

Inside the cluster you find Raspbian (based on Debian) on every node. I’m setting up each node using Ansible. This lets me run a script in the master node and all the nodes execute the same script in parallel. This way is pretty easy to install and setup software on each node without having to ssh into each node individually.

The cluster is based on this modular case from ModMyPi.

DSC_0358-536x408

 

The Raspberry Pi is a hungry beast. It requires around 2 Amps of current so you need enough power to power all five computers and the network switch.

This power supply, also from ModMyPi perfectly suits our needs, it’s able to deliver up to 2.5A per por port for all 6 ports.

e31ace2a15a7c70645ad83df9ecd43b0_XL

I spent some time searching for a small, low power network switch with enough ports for the 5 tiny computers, and also that let me power it with only 5 volts so I can simply connect it to a USB port.

The TP-LINK TL-SF1005D is the one to get. I just simply replaced the line coord with a USB connector to power it directly from the USB power supply, this way I can power up the whole cluster with just one mains cable.

tp_link_tl_sf1005d_switch_5_puertos_10_100

In addition, and just for fun, I wired up an LCD HD44780 with blue led backlight to the main node GPIO pins in the cluster so I can display useful information about what’s going on in the cluster.

1-2

I used RPLCD, a Python library for the Raspberry Pi to display text on the LCD.

IMG_20151220_022227

IMG_20151220_022344

The whole setup is only 20x25x12 cm and can perfectly fit in the top of your working desk.