Building a Hand-held Cluster for 120 Or 200, 150, 120, 100, 5!!! - - PowerPoint PPT Presentation

building a hand held cluster for 120
SMART_READER_LITE
LIVE PREVIEW

Building a Hand-held Cluster for 120 Or 200, 150, 120, 100, 5!!! - - PowerPoint PPT Presentation

Building a Hand-held Cluster for 120 Or 200, 150, 120, 100, 5!!! Inspira;on 2016 CPA Copenhagen Fringe presenta:on - Distributed Compu:ng on a (:ny) Budget: Building a Raspberry Pi Zero Microcluster Richard Miller I went


slide-1
SLIDE 1

Building a Hand-held Cluster for £120

Or €200, €150, €120, €100, €5!!!

slide-2
SLIDE 2

Inspira;on

2016 CPA Copenhagen Fringe presenta:on - Distributed Compu:ng on a (:ny) Budget: Building a Raspberry Pi Zero Microcluster Richard Miller I went home wan:ng to have one, but I’m lazy and didn’t want to do wiring and driver wri:ng.

slide-3
SLIDE 3
slide-4
SLIDE 4

Shopping List

Cluster HAT Kit £89.99

  • 1 x Cluster HAT
  • 4 x Raspberry Pi Zero
  • 4 x 16 GB Micro SD Card

Raspberry Pi 2 £30

  • Pi 3 has dynamic switching and may step down due to the heat

16GB Micro SD Card for Pi £10 Ethernet Cable and Power Supply (you probably have this lying around)

slide-5
SLIDE 5

OS Install and Startup

Cluster HAT website has Raspian images for each node. Enables gadget mode on the Pi Zeros (USB connec:vity). Pi 2 is controller; Zeros are p1, p2, p3, p4. Power by USB to the Pi 2. 2V required. Ethernet into a switch, or cross-over cable to your laptop

  • Laptop can also power the whole system.
slide-6
SLIDE 6

Interac;ng with the System

ssh into the controller. Four commands provided:

  • 1. clusterhat on pX
  • 2. clusterhat off pX
  • 3. clusterhat on all
  • 4. clusterhat off all

Once on we can ssh directly via the names. Useful to setup some other names in your /etc/hosts file.

slide-7
SLIDE 7

MPI Setup

We need to create a super user on each machine with no password. I used mpiuser. Use ssh-keygen and ssh-copy-id to setup passwordless login. Then install MPI

  • sudo apt install mpich
slide-8
SLIDE 8

Network File Storage Setup

Install NFS on the controller.

  • sudo apt install nfs-kernel-server

Login to the controller as mpiuser (or whatever name you used). Make a directory to share files. Then add a line to /etc/exports. For example:

  • /home/mpiuser/cloud *(rw, sync, no_root_squash, no_subtree_check)

Then update the exported filesystem

  • sudo exporls –a

And restart the NFS server

  • sudo service nfs-kernel-server restart
slide-9
SLIDE 9

Connec;ng the Clients

On each Pi Zero. Login as mpiuser (or equivalent). Install the NFS client.

  • sudo apt install nfs-common.

Make the shared folder and then mount it.

  • sudo mount –t nfs controller:/home/mpiuser/<name> ~/<name>

Can add to the mounts if you don’t mind a slightly slower startup.

slide-10
SLIDE 10

Demo

slide-11
SLIDE 11

Summary

Anyone can build there own cluster rela:vely cheaply, and now you can build a handheld one to. Performance isn’t great, but that isn’t the point. You can explore ideas wherever you go. Happy to discuss further if anyone wants.