/raspberry-pi-cluster

🔥 Building a Raspberry Pi 4 Cluster (home lab applications)

Building your own AWS: a 6-node Raspberry Pi 4 Cluster


alt text


Summary

  1. Overview
  2. Hardware
  3. Preparing SD Card
  4. Initial Pi Setup
  5. Done: next ideas

1. Overview

I built this cluster for many reasons:

  • Processing power
    • This setup itself has 24 cores in total (each Pi has 4 cores x 6 units) running at 1.5 Ghz (2 Ghz overclocked)
  • Studies
    • Lerning Kubernetes, docker swarm, monitoring and managing multiple nodes,
  • Research and Benchmarking
    • Comparison between protocols (udp, tcp, http, mqtt), cpu stock vs overclocked, how many clients we can handle, etc.

2. Hardware

The case itself was 3d printed on a Prusa i3 MK3 using PLA filament, I will leave the links for the printable parts and some footage from the process:

Plus this list of items purchased (link included):

Qty Item Price (CDN$) *
2 Raspberry Pi 4 - 4 GB $74.25
2 Raspberry Pi 4 - 2 GB $59.95
2 Raspberry Pi 4 - 1 GB $46.95
2 SD Card Gigastone 32 GB (5 pack) $32.98
6 Pimoroni Fan SHIM $19.99
1 Micro HDMI to HDMI cable $11.99
1 Copper Heatsink (8 pack) $9.99
1 Arctic MX-4 Thermal Paste $12.99
2 USB Type C Cable 1ft (5 pack) $12.99
1 Sabrent 60 Watt (12 Amp) 10-Port $36.99
1 NETGEAR S8000 8-Port Gigabit $102.99
  • The currency is Canadian Dollars.

2. Preparing SD Card

First, we need to download the OS. I am using Raspbian Buster Lite (terminal only), but there is a Desktop version included, but consuming more resources - which is something that we do not want to waste in a cluster setup.

Once we have downloaded the OS image, we have to save it in the SD Card:

Done, now we can go to the next step!


3. Initial Pi Setup

Once we have our SD card ready, we are now going to say "hello world" to each Pi node:

  • Connect the SD Card to the board
  • Connect the ethernet cable to the board to the router
  • Connect the USB-C cable to power on

[TODO...]

Fan Shim Python Script:

Custom config

  • Turn on at 60°
  • Turn off at 50°
  • RGB at 255
$ cd ~/fanshim-python/examples && sudo ./install-service.sh --on-threshold 60 --off-threshold 50 --delay 2 --brightness 255

Watching temp

$ watch -n 1 vcgencmd measure_temp

4. Done: next ideas

NGINX https://github.com/renancaldas/aws-ec2-guide#3-nginx https://www.digitalocean.com/community/tutorials/how-to-create-a-self-signed-ssl-certificate-for-nginx-in-ubuntu-16-04

[TODO...]