Also see
Hi-Five-Pi: Raspberry Pi Cluster Part 1 – Initial Hardware/Software Setup
Create a New User and Generate SSH Key for Passwordless Logins [Mac]
- On each node:
- Create your new user with this command (replace username with your choice): sudo useradd -m -u 1950 username
- Create a password for the user: sudo passwd username
- On the computer used to ssh to the cluster, generate ssh keys: ssh-keygen
- If you don’t want to use a passphrase, hit enter when asked to input one.
- Copy your public key over to each cluster node: ssh-copy-id username@node01
- You will be asked for your password.
- Next time you ssh to a node as this username, you should not be asked for a password, unless you chose a passphrase during step 3.
Setup Cluster Maintenance Software with Csshx [Mac]
- On the Mac used to ssh to the clusters, install Csshx with homebrew: brew install csshx
- Add an alias for the csshx command (this is for bash): nano ~/.bash_profile
- At the end of the file add this line, replacing with your data: alias clustername=’csshX username@node01 username@node02 username@node03 username@node04 username@node05’
- Refresh the shell: source ~/.bash_profile
- Now when you type in your cluster name in terminal, a window will open for each node along with a red window. Anything you type in the red window will be typed into all five nodes simultaneously.
Install Glances to Monitor Cluster Performance
- Using csshx, install glances on each node:
- Switch users since your username is not in the sudoers file: su pi
- Install glaces: sudo apt install glances
- Edit config file: sudo nano /etc/glances/glances.conf
- Scroll down to the server list section and add 3 lines for each node (port will be the same for each node):
- [serverlist]
- # Define the static servers list
- server_1_name=10.0.2.200
- server_1_alias=node01
- server_1_port=61209
- Under the passwords section, add a line for each node (use the password for the user who will be using glances):
- node01=yourpassword
- Scroll down to the server list section and add 3 lines for each node (port will be the same for each node):
- Open glaces in a browser: glances –browser
- You can also install glances on the computer you use to ssh to the cluster.
Resources
- Building a Raspberry Pi Cluster by Răzvan T. Coloja
- Building a Raspberry Pi Cluster by Garret Mills
- Build Supercomputers with Raspberry Pi 3 by Carlos R. Morrison