Building an ARM Computers Cluster using Raspberry Pis

Wendy Sanarwanto
Aug 28, 2017 · 7 min read

Back to early 2000s, I have been thinking about deploying & running my backend apps into my own clustered machines. However, I was held back due to the cost for building such this infrastructure would cost me lot of money, such for buying U1 racks or Blade machines and also preparing an air conditioned, wide place for housing these machines.

Fast forwarded to today, credit card sized ARM computer boards (SBC -Small Board Computer) are on rising. Hackers, hobbyist, students & developers start looking on these tiny computers, mostly to be used as part of their Internet of Things (IoT) projects. Beside the mini ARM machines are used for IoT projects, some people also used a number of these boards, stacked them up, built them as Clustered Computer, similar to U1 racks or Blade machines but they’re seems like the minified version those machines. They used the “mini blade” for learning & doing experimentation such as running Hadoop, web server farms, containers, databases, etc.

This fact awakes my dormant desire about running backend apps on my own cluster. I decided to start building my own, and would like to feel, see, experience the journey lies ahead of running my apps on my own -minified version of “Blade”. In this article, I am going to share my experience of building these stacked Tiny machines. Hope you, readers, would find it useful for building your own mini “Blade” as well.

Shopping the Parts

Parts to build the ARMs cluster

I bought the parts from various online stores, hosted in one of eCommerce giant platform in Indonesia, the Tokopedia. Below is the list of these parts, as you could see in the above screenshot:

  • Raspberry Pi 3 Model B (element 14 UK) — The ARM boards we are going to use for building the cluster
Raspberry Pi 3 Model B ARM Small Computers
  • Aluminium Heat Sink Heatsink — Aluminium block pieces that are going to be attached to surface of ARM Board’s chips, to dissipate an amount of heats during operation.
Heat sink aluminium blocks
  • 16 GB sized Micro SD Cards — Each of these cards will be the storage media of the ARM SBCs. We will format and install Raspbian OS in them so that they could be used for booting our ARM SBCs.
16 GB Micro SD cards
  • UTP Patch Cord Cat-6 cables — These cables are used for connecting the ARM boards through attaching them into a Switch Hub. to build a Local Area Network for the Cluster.
UTP CAT 6 LAN Cables
  • 8 Ports Switch Hub — connecting all of ARM Boards (through UTP cables), to form a Local Area Network which is a important part of the Cluster.
8 ports switch hub
  • OTG USB Cables — The cable are used for connecting the ARM boards to Power Supply unit.
OTG USB Cables
  • 6 USB ports 60W 5v/12 A power charger
  • Multi-level casing for housing the stacked RPis

The money that I spent for buying all of these parts in the list, is roughly $370 USD. To me, the cost is attractive for building a 5 ARM Boards cluster.

Install Raspbian OS on SD Cards

  • I picked one of the SD Card packages, unwrapped & unsealed. Then, I put it into my USB SD Card reader stick’s slot.
SD Card Reader USB stick
  • Once the SD Card is seated in, I plugged the USB stick into my Desktop PC running Ubuntu 16.04.3 LTS, then began erasing partition in the SD card using GParted application
Selecting existing partition on SD Card to delete.
the SD card with no partitions
  • Next, I opened Disksapplication, select the SD Card device and restore the Raspbian image into the SD Card.
Selecting Raspbian Image to restore to the Empty SD Card
Restoring Raspbian Image to the SD Card
SD Card with restored Raspbian
  • Ejected the SD card to USB stick and ejected the SD card from the USB stick as well.
  • I repeated prior steps against other remaining SD Cards

Plugged the SD Card to one ARM board and boot it up

  • I picked one ARM board, and put the aluminium heatsink pieces on the ARM board’s chips. The heatsinks that I bought, have sticky, termal paste on its bottom surface. So when I put the heatsinks, with the sticky surface on top the chip, the heatsinks sit & stick on the chip.
Attached Heatsinks on the Rpi’s Chips
  • Plugged the SD Card with Raspbian OS into the Rpi’s SD Card slot.
Insert the SD Card into Rpi’s SD Card slot
  • Plugged PC USB keyboard & Mouse into the Rpi’s USB ports
  • Plugged the Desktop LED Monitors into the Rpi’s HDMI port.
  • Then, I plugged a USB OTG power cable into the Rpi’s USB OTG female connector to power up the rpi. At this point, I had confirmed that the Raspi’s boot-up screen was shown up on my Desktop LED Monitor.
  • I fired up terminal window and began running sudo apt-get update && sudo apt-get upgrade -y for updating current softwares & libraries in the Rpi, into the latest version. Before I shutdown the RPi, I also changed /etc/hostname and /etc/hosts files, put static IP address in there so that the RPis could be accessed from my PC, or I could access them from other connected RPis later.

Clone the SD Card’s OS to other SD Cards

I shutdown the RPi. plugged my monitor & keyboard back to my PC and ejected the SD card from the turned off RPi. I inserted the SD Card back into my USB SD Card reader and backup the content by running dd command such as dd if=/dev/sde of=/home/wendysa/raspi-backups/raspbian-jassie_pristine.img bs=1M

Once I obtained the image file, I then restore the image on other SD cards and inserted them into the rest of RPis. By doing this way, I do not need to repeat prior steps to setup other RPis.

Assemble the Stacked ARM Boards

After all of RPis have been setup, I then bolted each of RPi to each of Multi Case’s plates. Then, I stacked & bolted each plates one to another using provided standoffs.

I connected each of RPis into the 8-ports Switch/Hub with UTP cat 6 cables , connect the switch into my Desktop PC, created a private Local network for them. Lastly, I connected the Anker USB Power Hub with the stacked RPis, before I powered the RPis up.

Unleash the Kraken !

Once all Network & USB Power Cables have been plugged, I then connected the Switch’s adaptor & USB Port Power hub into the main power outlet to bootup the RPis.

From here, I then setup the network interfaces of the RPis, sharing the internet connection on my desktop to them and setup DNS server in the Private Local Network so that I could reach each of them by their Hostname instead of by IP Addresses.

Next plan to do

In the near future, I am going to setup Docker Swarm on the RPis cluster. Then, I already have a number of things I’d like to try on the cluster, such as running Jenkins Master-Slave nodes for providing CI/CD when developing backend apps, cryptocurrency mining , load balancing , HA simulation and many more.

)

Wendy Sanarwanto

Written by

I have been dedicating myself as a Software Engineer since 2002. I live in Kuta, Bali, working on a a big software outsourcing company since 2007 until now.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade