PicoCluster Configuration Guide
This is a guide to show you how to configure your PicoCluster. If you purchase a Cube, this work is already set up for you. Configuration time is about 15 minutes.
Step 1:
The first step is to get get all of the nodes to talk to each other. If you take a look at the hosts file, you'll see that the node references are set up already.
This is the default node layout for a Pico 5
10.1.10.240 pc0 10.1.10.241 pc1 10.1.10.242 pc2 10.1.10.243 pc3 10.1.10.244 pc4
The first script you want to run is genKeys.sh. This script will generate and SSH key on PC0, copy the key to the other nodes in the cluster and add them to the known_hosts file.
This is what the run looks like. For each node, you'll be asked to confirm the connection. Type "yes". Then you'll be asked for the password which is picocluster by default.
picocluster@pc0:~ $ sh genKeys.sh Generating public/private rsa key pair. Created directory '/home/picocluster/.ssh'. Your identification has been saved in /home/picocluster/.ssh/id_rsa. Your public key has been saved in /home/picocluster/.ssh/id_rsa.pub. The key fingerprint is: a2:06:b8:43:12:ee:28:aa:8d:97:2a:cb:ee:84:c5:55 picocluster@pc0 The key's randomart image is: +---[RSA 2048]----+ | E | | . | |. . | |.+ . | |oo+ . S | |*o . . . | |*o .o | |*+o. | |@B. | +-----------------+ The authenticity of host 'pc1 (10.1.10.241)' can't be established. ECDSA key fingerprint is c2:69:58:03:80:c7:7e:ae:a4:97:c8:ee:4e:f0:aa:88. Are you sure you want to continue connecting (yes/no)? yes /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys picocluster@pc1's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'picocluster@pc1'" and check to make sure that only the key(s) you wanted were added. The authenticity of host 'pc2 (10.1.10.242)' can't be established. ECDSA key fingerprint is c2:69:58:03:80:c7:7e:ae:a4:97:c8:ee:4e:f0:aa:88. Are you sure you want to continue connecting (yes/no)? yes /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys picocluster@pc2's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'picocluster@pc2'" and check to make sure that only the key(s) you wanted were added. The authenticity of host 'pc3 (10.1.10.243)' can't be established. ECDSA key fingerprint is c2:69:58:03:80:c7:7e:ae:a4:97:c8:ee:4e:f0:aa:88. Are you sure you want to continue connecting (yes/no)? yes /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys picocluster@pc3's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'picocluster@pc3'" and check to make sure that only the key(s) you wanted were added. The authenticity of host 'pc4 (10.1.10.244)' can't be established. ECDSA key fingerprint is c2:69:58:03:80:c7:7e:ae:a4:97:c8:ee:4e:f0:aa:88. Are you sure you want to continue connecting (yes/no)? yes /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys picocluster@pc4's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'picocluster@pc4'" and check to make sure that only the key(s) you wanted were added.
Now we need to add PC0 to it's known_hosts file so SSH can see it properly. That is done by simply SSHing to itself, then exiting back to the original shell.
picocluster@pc0:~ $ ssh pc0 The authenticity of host 'pc0 (10.1.10.240)' can't be established. ECDSA key fingerprint is c2:69:58:03:80:c7:7e:ae:a4:97:c8:ee:4e:f0:aa:88. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'pc0,10.1.10.240' (ECDSA) to the list of known hosts. The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Mon Dec 12 12:23:36 2016 from 10.1.10.19 picocluster@pc0:~ $ exit logout Connection to pc0 closed.
Step 2:
Test to make sure that all of the nodes can talk to each other. The script, testAllNodes.sh, will help us to this. It simply does a 'df -h' on all nodes and shows you the results. As you'll see, each node is showing about 7G on the /dev/root file system. This is because the default file system if built on an 8GB(1000 bytes per K).
picocluster@pc0:~ $ sh testAllNodes.sh testing pc4 Filesystem Size Used Avail Use% Mounted on /dev/root 7G 3.3G 3.7G 47% / devtmpfs 459M 0 459M 0% /dev tmpfs 463M 0 463M 0% /dev/shm tmpfs 463M 6.3M 457M 2% /run tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 463M 0 463M 0% /sys/fs/cgroup /dev/mmcblk0p1 63M 21M 43M 33% /boot tmpfs 93M 0 93M 0% /run/user/1000 tmpfs 93M 0 93M 0% /run/user/109 tmpfs 93M 0 93M 0% /run/user/1001 testing pc3 Filesystem Size Used Avail Use% Mounted on /dev/root 7G 3.3G 3.7G 47% / devtmpfs 459M 0 459M 0% /dev tmpfs 463M 0 463M 0% /dev/shm tmpfs 463M 6.3M 457M 2% /run tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 463M 0 463M 0% /sys/fs/cgroup /dev/mmcblk0p1 63M 21M 43M 33% /boot tmpfs 93M 0 93M 0% /run/user/1000 tmpfs 93M 0 93M 0% /run/user/109 tmpfs 93M 0 93M 0% /run/user/1001 testing pc2 Filesystem Size Used Avail Use% Mounted on /dev/root 7G 3.3G 3.7G 47% / devtmpfs 459M 0 459M 0% /dev tmpfs 463M 0 463M 0% /dev/shm tmpfs 463M 6.3M 457M 2% /run tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 463M 0 463M 0% /sys/fs/cgroup /dev/mmcblk0p1 63M 21M 43M 33% /boot tmpfs 93M 0 93M 0% /run/user/1000 tmpfs 93M 0 93M 0% /run/user/109 tmpfs 93M 0 93M 0% /run/user/1001 testing pc1 Filesystem Size Used Avail Use% Mounted on /dev/root 7G 3.3G 3.7G 47% / devtmpfs 459M 0 459M 0% /dev tmpfs 463M 0 463M 0% /dev/shm tmpfs 463M 6.3M 457M 2% /run tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 463M 0 463M 0% /sys/fs/cgroup /dev/mmcblk0p1 63M 21M 43M 33% /boot tmpfs 93M 0 93M 0% /run/user/1000 tmpfs 93M 0 93M 0% /run/user/109 tmpfs 93M 0 93M 0% /run/user/1001 testing pc0 Filesystem Size Used Avail Use% Mounted on /dev/root 7G 3.4G 3.7G 47% / devtmpfs 459M 0 459M 0% /dev tmpfs 463M 0 463M 0% /dev/shm tmpfs 463M 6.4M 457M 2% /run tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 463M 0 463M 0% /sys/fs/cgroup /dev/mmcblk0p1 63M 21M 43M 33% /boot tmpfs 93M 0 93M 0% /run/user/1000 tmpfs 93M 0 93M 0% /run/user/109 tmpfs 93M 0 93M 0% /run/user/1001
Step 3:
Resize the root file system to be the proper size. PicoCluster Image Set is build on 8GB micro SD card images. This means that the root file system needs to be resized to take full advantage of the micro SD cards installed in your PicoCluster. This is done a bit differently depending on which SBCs are installed in your PicoCluster.
Raspberry PI:
Rasbian already has an excellent tool built in called raspi-config. Raspi-config can be use to change many parameters for Raspberry PI. We're only interested in changing the root file system size.
Start by typing the following and pressing return:
picocluster@pc0:~ $ sudo raspi-config
Raspi-config is a shell-gui application so you'll see the following screen.
Select option 1 and press enter.
You'll get the following screen. Press enter again. This will take you back to the main menu screen.
Press the tab key twice to highlight <Finish> and press enter.
You will be asked to reboot. Press enter and that node will reboot.
Follow this same procedure for all nodes in your cluster. When all nodes have rebooted, open up a shell window on PC0 and run the testAllNodes.sh script again. You should see that /dev/root file system is the proper size now. This example is for 16GB micro SD cards.
picocluster@pc0:~ $ sh testAllNodes.sh testing pc4 Filesystem Size Used Avail Use% Mounted on /dev/root 15G 3.3G 11G 24% / devtmpfs 459M 0 459M 0% /dev tmpfs 463M 0 463M 0% /dev/shm tmpfs 463M 6.3M 457M 2% /run tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 463M 0 463M 0% /sys/fs/cgroup /dev/mmcblk0p1 63M 21M 43M 33% /boot tmpfs 93M 0 93M 0% /run/user/1000 tmpfs 93M 0 93M 0% /run/user/109 tmpfs 93M 0 93M 0% /run/user/1001 testing pc3 Filesystem Size Used Avail Use% Mounted on /dev/root 15G 3.3G 11G 24% / devtmpfs 459M 0 459M 0% /dev tmpfs 463M 0 463M 0% /dev/shm tmpfs 463M 6.3M 457M 2% /run tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 463M 0 463M 0% /sys/fs/cgroup /dev/mmcblk0p1 63M 21M 43M 33% /boot tmpfs 93M 0 93M 0% /run/user/1000 tmpfs 93M 0 93M 0% /run/user/109 tmpfs 93M 0 93M 0% /run/user/1001 testing pc2 Filesystem Size Used Avail Use% Mounted on /dev/root 15G 3.3G 11G 24% / devtmpfs 459M 0 459M 0% /dev tmpfs 463M 0 463M 0% /dev/shm tmpfs 463M 6.3M 457M 2% /run tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 463M 0 463M 0% /sys/fs/cgroup /dev/mmcblk0p1 63M 21M 43M 33% /boot tmpfs 93M 0 93M 0% /run/user/1000 tmpfs 93M 0 93M 0% /run/user/109 tmpfs 93M 0 93M 0% /run/user/1001 testing pc1 Filesystem Size Used Avail Use% Mounted on /dev/root 15G 3.3G 11G 24% / devtmpfs 459M 0 459M 0% /dev tmpfs 463M 0 463M 0% /dev/shm tmpfs 463M 6.3M 457M 2% /run tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 463M 0 463M 0% /sys/fs/cgroup /dev/mmcblk0p1 63M 21M 43M 33% /boot tmpfs 93M 0 93M 0% /run/user/1000 tmpfs 93M 0 93M 0% /run/user/109 tmpfs 93M 0 93M 0% /run/user/1001 testing pc0 Filesystem Size Used Avail Use% Mounted on /dev/root 15G 3.4G 11G 24% / devtmpfs 459M 0 459M 0% /dev tmpfs 463M 0 463M 0% /dev/shm tmpfs 463M 6.4M 457M 2% /run tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 463M 0 463M 0% /sys/fs/cgroup /dev/mmcblk0p1 63M 21M 43M 33% /boot tmpfs 93M 0 93M 0% /run/user/1000 tmpfs 93M 0 93M 0% /run/user/109 tmpfs 93M 0 93M 0% /run/user/1001
Odroid C2 and Pine64:
Both of these clusters running Ubuntu Mate and so the configuration is the same for both. This is the desktop with a shell window open.
The root file system resize is a bit different for Ubuntu Mate. It is a 2-step process that requires a reboot between runs of the script. The script is located in /root/resize.fs and requires the user become root in order 2 run.
ssh to pc4 (assuming a Pico 5), sudo to root, then run the resize.sh script. After the script runs, reboot the node using either the reboot or init 6 command. You'll see something like the following. Repeat for all 5 nodes.
picocluster@pc0:~$ ssh pc4 Welcome to Ubuntu 16.04 LTS (GNU/Linux 3.10.101-4-pine64-longsleep aarch64) * Documentation: https://help.ubuntu.com/ 334 packages can be updated. 130 updates are security updates. Last login: Thu Feb 11 16:29:09 2016 from 10.1.10.240 picocluster@pc4:~$ sudo su - root@pc4:~# sh resize.sh Found the start point of mmcblk0p2: 143360 Re-reading the partition table failed.: Device or resource busy Ok, Partition resized, please reboot now Once the reboot is completed please run this script again root@pc4:~# init 6 Connection to pc4 closed by remote host. Connection to pc4 closed. picocluster@pc0:~$
Once all nodes come back, the script must be run a second time. ssh to pc4, sudo to root, then run the resize.sh script. Once this is completed, then the /dev/root will be expanded to full size. Exit twice to return back to pc0. It will look like this. Repeat for all 5 nodes.
picocluster@pc0:~$ ssh pc4 Welcome to Ubuntu 16.04 LTS (GNU/Linux 3.10.101-4-pine64-longsleep aarch64) * Documentation: https://help.ubuntu.com/ 334 packages can be updated. 130 updates are security updates. Last login: Tue Dec 13 18:34:27 2016 from 10.1.10.240 picocluster@pc4:~$ sudo su - root@pc4:~# sh resize.sh Activating the new size resize2fs 1.42.13 (17-May-2015) Done! Enjoy your new space! root@pc4:~# exit logout picocluster@pc4:~$ exit logout Connection to pc4 closed. picocluster@pc0:~$
Once you're back at pc0, then run the testAllNodes.sh script again. You should see output like the following. This is with 16GB micro SD cards.
picocluster@pc0:~$ sh testAllNodes.sh testing pc4 Filesystem Size Used Avail Use% Mounted on /dev/mmcblk0p2 15G 4.6G 9.4G 33% / devtmpfs 962M 0 962M 0% /dev tmpfs 995M 0 995M 0% /dev/shm tmpfs 995M 8.9M 986M 1% /run tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 995M 0 995M 0% /sys/fs/cgroup /dev/mmcblk0p1 50M 13M 38M 25% /boot tmpfs 199M 4.0K 199M 1% /run/user/108 tmpfs 199M 0 199M 0% /run/user/1001 testing pc3 Filesystem Size Used Avail Use% Mounted on /dev/mmcblk0p2 15G 4.6G 9.4G 33% / devtmpfs 962M 0 962M 0% /dev tmpfs 995M 0 995M 0% /dev/shm tmpfs 995M 8.9M 978M 1% /run tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 995M 0 995M 0% /sys/fs/cgroup /dev/mmcblk0p1 50M 13M 38M 25% /boot tmpfs 199M 4.0K 199M 1% /run/user/108 tmpfs 199M 0 199M 0% /run/user/1001 testing pc2 /dev/mmcblk0p2 15G 4.6G 9.4G 33% / devtmpfs 962M 0 962M 0% /dev tmpfs 995M 0 995M 0% /dev/shm tmpfs 995M 8.9M 986M 1% /run tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 995M 0 995M 0% /sys/fs/cgroup /dev/mmcblk0p1 50M 13M 38M 25% /boot tmpfs 199M 4.0K 199M 1% /run/user/108 tmpfs 199M 0 199M 0% /run/user/1001 testing pc1 Filesystem Size Used Avail Use% Mounted on /dev/mmcblk0p2 15G 4.6G 9.4G 33% / devtmpfs 962M 0 962M 0% /dev tmpfs 995M 0 995M 0% /dev/shm tmpfs 995M 8.9M 986M 1% /run tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 995M 0 995M 0% /sys/fs/cgroup /dev/mmcblk0p1 50M 13M 38M 25% /boot tmpfs 199M 4.0K 199M 1% /run/user/108 tmpfs 199M 0 199M 0% /run/user/1001 testing pc0 Filesystem Size Used Avail Use% Mounted on /dev/mmcblk0p2 15G 4.6G 9.4G 33% / devtmpfs 962M 0 962M 0% /dev tmpfs 995M 0 995M 0% /dev/shm tmpfs 995M 8.9M 986M 1% /run tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 995M 0 995M 0% /sys/fs/cgroup /dev/mmcblk0p1 50M 13M 38M 25% /boot tmpfs 199M 4.0K 199M 1% /run/user/108 tmpfs 199M 0 199M 0% /run/user/1001
Now you're up and running with a fully configured PicoCluster!
Contact us at support@picocluster.com for questions.