Raspberry Pi Cluster - Part 1: The Build
As my desire for self hosting services has grown, so too has my requirement for computing power, and fault tolerance.
So I bit the bullet and bought 4 off Raspberry Pi 4 single board computers. If you're not familiar with Raspberry Pis, check out https://www.raspberrypi.com/. I got my gear from Core Electronics.
Bill of Materials
Item | Qty |
---|---|
Raspberry Pi 4; 8GB | 4 |
PoE+ Hat | 4 |
Tower Case | 1 |
PoE Network Switch | 1 |
I bought the 8GB model because:
- I'm greedy
- You can never have enough RAM
- Kubernetes requires disabling of swap
- You can never have enough RAM.
I'm not running kubernetes at this stage, but it may become a part of my stack soon.
I'd seen a number of projects that stack the Pis into a towers or slots. I thought that would be pretty neat to keep things organised. While I was shopping around for the Pis and hats, I saw the tower mount enclosure, so I snapped one up. I don't have the means to be cutting acrylic cases, so I appreciated that this was already done for me. All I had to do was assemble.
I bought the PoE+ hats so that I could reduce the number of cables and keep it clean. My cable management skills aren't very good, and neither is the market for adequate power supplies. I'd also recently purchased an 8 port network switch that has 4 ports with PoE. The other ports will be used by the incoming network cable, and three other machines.
I also want to set this cluster up using network boot. Why? I don't know, but seems like a good challenge, right?
There are some articles and blogs that talk about the limited life of SD cards, but I've only ever had one fail before. In any case, this means I don't have to have an SD card for each device, and I can manage all the volumes on the NAS if needed.
My only gripe with the setup that I've bought is that the acrylic case doesn't really accommodate the PoE hats. It's not too hard to work around, so here's how I did it.
Step 1
The PoE+ hats come with 4 spacers and 8 screws. You're supposed to screw the spacer in from both the top of the hat, and the bottom of the Raspberry Pi. In this case, I've only screwed the spacer onto the hat, and then installed the hat onto the Pi. We'll need the bottom mounting holes clear later on.
Step 2
As I mentioned before, the acrylic case doesn't quite have the vertical clearance to allow for the PoE hats and the normal spacing layout. There are small spacer discs included with the case, and a number of nylon nuts and screws. While there are no official instructions for this case, I'm certain that one is supposed to bolt the Pi onto the acrylic floor using the nylon nuts and screws, with a spacer in between.
The problem is, with the PoE+ hat spacer taking up the mounting hole, there's no way for us to get the nylon screw in.
I couldn't possibly call myself an enguneer, enjineer, enjunear if I couldn't figure something out. So what if we just put the nut and screw through the acrylic floor, and used that as a locator for the Raspberry Pi?
And hey presto! It works like a charm. Only one board needed a little encouragement to completely mount onto the screws, but it was no more than is required to click the board into place in the official cases.
The underside doesn't quite have the same spacing as if I had used the spacers properly, but that's not the main area of concern. The top side, however, does have a few millimetres for air to flow.
Step 3
Before I finish putting the tower together, I need to get some information from each device. This is the information required to set up the network booting.
Read more in the next post, coming soonTM.