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]

  1. On each node:
    1. Create your new user with this command (replace username with your choice): sudo useradd -m -u 1950 username
    2. Create a password for the user: sudo passwd username
  2. On the computer used to ssh to the cluster, generate ssh keys: ssh-keygen
    1. If you don’t want to use a passphrase, hit enter when asked to input one.
  3. Copy your public key over to each cluster node: ssh-copy-id username@node01
    1. You will be asked for your password.
  4. 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]

  1. On the Mac used to ssh to the clusters, install Csshx with homebrew: brew install csshx
  2. Add an alias for the csshx command (this is for bash): nano ~/.bash_profile
    1. 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’
    2. Refresh the shell: source ~/.bash_profile
  3. 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

  1. Using csshx, install glances on each node:
    1. Switch users since your username is not in the sudoers file: su pi
    2. Install glaces: sudo apt install glances
  2. Edit config file: sudo nano /etc/glances/glances.conf
    1. Scroll down to the server list section and add 3 lines for each node (port will be the same for each node):
      1. [serverlist]
      2. # Define the static servers list
      3. server_1_name=10.0.2.200
      4. server_1_alias=node01
      5. server_1_port=61209
    2. Under the passwords section, add a line for each node (use the password for the user who will be using glances):
      1. node01=yourpassword
  3. Open glaces in a browser: glances –browser
  4. You can also install glances on the computer you use to ssh to the cluster.


Resources