## Download files from https://clusterhat.com/setup-software NOTE: Download two files that are complete sets of images. ## USB Boot download http://dist.8086.net/clusterhat/ClusterHAT-2017-11-29-lite-2-usbboot.zip ## Unzip img files. unzip ClusterHAT-2017-11-29-lite-2-usbboot.zip unzip ClusterHAT-2018-03-13-1-ALL.zip Username: pi Password: clusterhat # Create a wpa_supplicant.conf file # see example vi wpa_supplicant.conf ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 country=US network={ ssid="TEST-LAB" psk="testlab2018" } # Determine which disk diskutil list # diskutil unmountDisk /dev/disk # sudo dd bs=1m if=image.img of=/dev/rdisk conv=sync # RPI #1 diskutil unmountDisk /dev/disk2 sudo dd bs=1m if=ClusterHAT-2018-03-13-lite-1-p1.img of=/dev/rdisk2 conv=sync touch /Volumes/boot/ssh cp wpa_supplicant.conf /Volumes/boot/ diskutil unmountDisk /dev/disk2 # RPI #2 diskutil unmountDisk /dev/disk2 sudo dd bs=1m if=ClusterHAT-2018-03-13-lite-1-p2.img of=/dev/rdisk2 conv=sync touch /Volumes/boot/ssh cp wpa_supplicant.conf /Volumes/boot/ diskutil unmountDisk /dev/disk2 # RPI #3 diskutil unmountDisk /dev/disk2 sudo dd bs=1m if=ClusterHAT-2018-03-13-lite-1-p3.img of=/dev/rdisk2 conv=sync touch /Volumes/boot/ssh cp wpa_supplicant.conf /Volumes/boot/ diskutil unmountDisk /dev/disk2 # RPI #4 diskutil unmountDisk /dev/disk2 sudo dd bs=1m if=ClusterHAT-2018-03-13-lite-1-p4.img of=/dev/rdisk2 conv=sync touch /Volumes/boot/ssh cp wpa_supplicant.conf /Volumes/boot/ diskutil unmountDisk /dev/disk2 # RPI Controller diskutil unmountDisk /dev/disk2 sudo dd bs=1m if=ClusterHAT-2018-03-13-1-controller.img of=/dev/rdisk2 conv=sync touch /Volumes/boot/ssh cp wpa_supplicant.conf /Volumes/boot/ diskutil unmountDisk /dev/disk2 # RPI Controller USB Boot diskutil unmountDisk /dev/disk2 sudo dd bs=1m if=ClusterHAT-2017-11-29-lite-2-usbboot.img of=/dev/rdisk2 conv=sync touch /Volumes/boot/ssh cp wpa_supplicant.conf /Volumes/boot/ diskutil unmountDisk /dev/disk2 # Establish ssh # Assumes no public/private key on the Controller Pi ssh-keygen -t rsa ## Press enter to save the key at the standard location (/home/pi/.ssh/id_rsa), ## you can optionally enter a passphrase but you will need to enter this every ## time you access the key. # Copy your public SSH key to the Pi Zeros for I in 1 2 3 4; do echo "Copying to p$I.local";ssh-copy-id pi@p$I.local;done ## For each Pi you will need to type "yes" to connect if you haven't already ## previously logged into the Zero from the Controller using SSH and then ## enter your password. ## You will now be able to log into the Pi Zeros using SSH without any key ssh pi@p1.local ## To run a command on all Pi Zeros sequentially you can reuse a portion ## of the above command. for I in 1 2 3 4; do echo -n "p$I:";ssh pi@p$I.local uptime;done ## You should see something similar to the output below which shows how ## long each Pi Zero has been booted, number of users, etc. ## Alternatively for USB Boot ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa mkdir -p /var/lib/clusterhat/nfs/p{1,2,3,4}/home/pi/.ssh/ cat ~/.ssh/id_rsa.pub >> /var/lib/clusterhat/nfs/p1/home/pi/.ssh/authorized_keys cat ~/.ssh/id_rsa.pub >> /var/lib/clusterhat/nfs/p2/home/pi/.ssh/authorized_keys cat ~/.ssh/id_rsa.pub >> /var/lib/clusterhat/nfs/p3/home/pi/.ssh/authorized_keys cat ~/.ssh/id_rsa.pub >> /var/lib/clusterhat/nfs/p4/home/pi/.ssh/authorized_keys