Warning: Steem witnesses executed a hard fork on 2020-05-20, seizing 23.6M STEEM from 65 accounts. The funds were transferred to an account named @community321, the ownership (and intentions) of which have not been revealed. The witnesses claim to have been targeting accounts which defended against a hostile takeover in early March, but at least 2 accounts on the list have been inactive for over 4 years.

Coverage:
- Decrypt.io: Steem network to seize $5 million from its own users
- SteemPeak.com: Official Announcement by @softfork22888
- GitHub.com: view steemd HF23 changes

What you can do:
- Send exchanges a notice of the pending class action lawsuit.
- Switch to HIVE, the community-led fork. Visit Hive.blog and Hiveblocks.com.

Cluster Hat with Docker Swarm by dickturpin

View this thread on steempeak.com
· @dickturpin · (edited)
$1.53
Cluster Hat with Docker Swarm
<center>https://www.cannon-linux.co.uk/wp-content/uploads/2020/06/Pi_Featured_image.png</center>

<h2>"What are you using it for?"</h2>

<div class="pull-left">

https://www.cannon-linux.co.uk/wp-content/uploads/2020/06/clusterhat_portainer-146x300.jpg

</div>

<h4><em>"To learn!"</em> should be your stock response.</h4>

<p>I purchased the <a href="https://clusterhat.com/" target="_blank">Clusterhat</a> a while back as a scaled-down version of <a href="https://www.cannon-linux.co.uk/2014/08/frankenpi-part-1/" target="_blank">FrankenPi</a> although given the age of FrankenPi the scale of Clusterhat has more to do with physical size than computing ability. To be honest I suspect Clusterhat is as powerful if not more so if I could only be bothered to do a benchmark test on both projects to find out. Obviously there are literally hundreds of uses for Clusterhat and a multitude of ways to configure it, personally, I like <a href="https://docs.docker.com/engine/swarm/" target="_blank">Docker Swarm</a> mainly because it is so simple to install and easy to set up.</p>

<p>I wrote this mainly as a walkthrough for myself, there's no particular order to set up Storage and Docker I just prefer to do it this way. If you choose to follow what I've written here you do so at your own risk. This walkthrough comes with no support whatsoever. <em>"If you break it you get to keep all the pieces."</em></p>

<h3>Setup shared storage device</h3>

<div class="pull-left">

https://files.peakd.com/file/peakd-hive/dickturpin/ucaETKIV-USB3-2.png

</div>

<p>Most of us have a USB storage device slung at the back of a drawer somewhere. You don't need to have it but it will come in handy sometimes. To find out where the storage device is loaded in /dev, we need to run the lsblk command:</p><pre class="ga gb gc gd ge jn jo jp">$ lsblk</pre></p>

<p>The output should look something like this.</p>

</p><pre class="ga gb gc gd ge jn jo jp">NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT

sda 8:0 1 28.9G 0 disk

└─sda1 8:1 1 28.9G 0 part /media/storage

mmcblk0 179:0 0 14.9G 0 disk

├─mmcblk0p1 179:1 0 256M 0 part /boot

└─mmcblk0p2 179:2 0 14.6G 0 part /</pre></p>

<p>I had already formatted my drive but you may wish to use the mkfs.ext4 command. Just make doubly sure you are formatting the correct drive: "You wipe it, you lose it!"</p>

<p><pre class="ga gb gc gd ge jn jo jp">sudo mkfs.ext4 /dev/sda1</pre></p>

<p>I generally use /media for mounting external drives, but you can place the folder anywhere on your filesystem. Make sure you use the same folder across all of your nodes!</p>

<p>Let's go ahead and create the folder where you will mount the storage device.</p>

<p><pre class="ga gb gc gd ge jn jo jp">sudo mkdir /media/Storage

sudo chown nobody.nogroup -R /media/Storage

sudo chmod -R 777 /media/Storage</pre></p>

<div class="pull-left">

https://files.peakd.com/file/peakd-hive/dickturpin/LST8EvS8-circle-warn.png

</div>

<h2>"Warning!"</h2>

<p>This drive has the dangerous 777 full permissions set, anyone who has access to your Raspberry pi will be able to read, modify, and remove the contents of the storage device. I'm doing it this way because I know only I will have access If you are using the cluster in a production environment you will need to use different permissions to the ones I have.</p>

<p>Now we need to run the blkid command so we can get the UUID of the drive. This will enable us to set up the automatic mounting of the drive whenever the pi is rebooted. The output will look similar to this:</p>

<p><pre class="ga gb gc gd ge jn jo jp">/dev/sda1: UUID="ff26ae00-4289-4acc-95a4-35d37c6a0c27" TYPE="ext4" PARTUUID="7a6687b0-01"</pre></p>

<p>The information you are looking for is:</p>

<p><pre class="ga gb gc gd ge jn jo jp">UUID="ff26ae00-4289-4acc-95a4-35d37c6a0c27"</pre></p>

<p>Now we need to add the storage device to the bottom of your fstab.</p>

<div class="pull-left">

https://files.peakd.com/file/peakd-hive/dickturpin/LST8EvS8-circle-warn.png

</div>

<h2>"Warning!"</h2>

<p>Make sure you substitute your drives UUID and not the one in this guide. We've all done it but copy-n-paste can be dangerous sometimes.</p>

<p><pre class="ga gb gc gd ge jn jo jp">sudo vim /etc/fstab

UUID=ff26ae00-4289-4acc-95a4-35d37c6a0c27 /media/Storage ext4 defaults 0 2</pre></p>

<p>Now let's install NFS server if you haven't already done it.</p>

<p><pre class="ga gb gc gd ge jn jo jp">sudo apt-get install -y nfs-kernel-server</pre></p>

<p>Now we'll need to edit /etc/exports and place the following at the bottom:</p>

<p><pre class="ga gb gc gd ge jn jo jp">sudo vim /media/Storage

172.19.181.0/24(rw,sync,no_root_squash,no_subtree_check)</pre></p>

<div class="pull-left">

https://files.peakd.com/file/peakd-hive/dickturpin/LST8EvS8-circle-warn.png

</div>

<h2>"Warning!"</h2>

<p>If you used the CBRIDGE image, you'll need to use the IP address of your network. So if your network is using 192.168.1.0 you'll need to change the 172.19.181.0 to 192.168.1.0 in the command I gave.</p>

<p>Next up we need to update the NFS server:</p>

<p><pre class="ga gb gc gd ge jn jo jp">sudo exportfs -a</pre></p>

<p>Now to add the storage device to each of the Nodes (Pi Zero's) This is pretty much the same procedure we have already completed.</p>

<div class="pull-left">

https://files.peakd.com/file/peakd-hive/dickturpin/LST8EvS8-circle-warn.png

</div>

<h2>"Warning!"</h2>

<p>Remember what I said earlier about CBRIDGE &amp; NAT and changing IP's</p>

<p><pre class="ga gb gc gd ge jn jo jp">sudo apt-get install -y nfs-common

sudo mkdir /media/Storage

sudo chown nobody.nogroup /media/Storage

sudo chmod -R 777 /media/Storage</pre></p>

<p>You will need to add a slightly different entry to the bottom of fstab on each and every Node (Pi Zero)</p>

<p><pre class="ga gb gc gd ge jn jo jp">sudo vi /etc/fstab

172.19.181.254:/media/Storage /media/Storage nfs defaults 0 0</pre></p>

<p>Now let's run:</p>

<p><pre class="ga gb gc gd ge jn jo jp">sudo mount -a</pre></p>

<p>If you have any errors, double check your /etc/fstab files in the nodes and the /etc/exports file on the controller.</p>

<p>Next, create a text file inside the NFS mount directory /media/Storage to ensure that you can see it across all of the nodes (Pi Zero's). To confirm it's working do:</p>

<p><pre class="ga gb gc gd ge jn jo jp">echo “Please work” &gt;&gt; /media/Storage/test.txt</pre></p>

<p>Fingers crossed:</p>

<p><pre class="ga gb gc gd ge jn jo jp">cat /media/Storage/test.txt

</pre></p>

<p><pre class="ga gb gc gd ge jn jo jp">"Please work"

</pre></p>

<h2>Let's install Docker</h2>

<p><pre class="ga gb gc gd ge jn jo jp"><b>My Clusterhat Hostnames</b>

Host - pi0

↳Node - p1

↳Node - p2

↳Node - p3

↳Node - p4</pre></p>

<p>Starting with the Clusterhat Host, in my case pi0 I first like to make sure the system is up to date before I begin.</p>

<p><pre class="ga gb gc gd ge jn jo jp">sudo apt-get update &amp;&amp; sudo apt-get upgrade -y

</pre></p>

<p>Now we'll fetch and install Docker.</p>

<p><pre class="ga gb gc gd ge jn jo jp">sudo curl -sSL https://get.docker.com | sh

</pre></p>

<p>Now we'll add (in my case) the user pi to the group Docker:</p>

<p><pre class="ga gb gc gd ge jn jo jp">sudo usermod -aG docker pi

</pre></p>

<p>You'll need to repeat this on all the Nodes (Pi Zero's)</p>

<p>Now let's advertise your Host (Manager, main machine whatever you like to call it)</p>

<p><pre class="ga gb gc gd ge jn jo jp">sudo docker swarm init --advertise-addr 192.168.1.18

</pre></p>

<p>Docker Swarm needs a Quorum so let's add a couple more managers by generating a "join" token:</p>

<p><pre class="ga gb gc gd ge jn jo jp">sudo docker swarm join-token manager

</pre></p>

<p>This will output something similar to this:</p>

<p><pre class="ga gb gc gd ge jn jo jp">docker swarm join --token SWMTKN-1-03zr59oxg229jf7wpior8nkuoasj7e59qkgk0on37zvgkoo4av-4gdx5zuihs60jwzrbhigw79iz 192.168.1.18:2377

</pre></p>

<p>Now we need to ssh into p1.local and paste the output into a Terminal. Docker should report back that p1.local has joined as a manager. ssh into p2.local and repeat the process. We now have three Managers pi0, p1 &amp; p2 forming our Quorum.</p>

<p>Next we must create some workers:</p>

<p><pre class="ga gb gc gd ge jn jo jp">sudo docker swarm join-token worker</pre></p>

<p>This will output something similar to this:</p>

<p><pre class="ga gb gc gd ge jn jo jp">docker swarm join --token SWMTKN-1-03zr59oxg229jf7wpior8nkuoasj7e59qkgk0on37zvgkoo4av-26dvf5ou5p8w2lab3tat3epmn 192.168.1.18:2377</pre></p>

<p>ssh into p3.local and p4.local respectively and paste that output into a Terminal on each Node (Pi Zero)</p>

<p>Now nip back to the Host pi0 and see if everything is OK:</p>

<p><pre class="ga gb gc gd ge jn jo jp">sudo docker node ls</pre></p>

<p>Docker should report back something similar to this:</p>

<p><table style="border-collapse: collapse; width: 76.8924%; height: 132px;">

<tbody>

<tr style="height: 22px;">

<td style="width: 12.5%; height: 22px;">ID</td>

<td style="width: 12.5%; height: 22px;">HOSTNAME</td>

<td style="width: 12.5%; height: 22px;">STATUS</td>

<td style="width: 12.5%; height: 22px;">AVAILABILITY</td>

<td style="width: 13.8247%; height: 22px;" nowrap="nowrap">MANAGER STATUS</td>

<td style="width: 7.37666%; height: 22px;">ENGINE</td>

</tr>

<tr style="height: 22px;">

<td style="width: 12.5%; height: 22px;">uckdf3wgwkq10p1zalkocfr3q</td>

<td style="width: 12.5%; height: 22px;">p1</td>

<td style="width: 12.5%; height: 22px;">Ready</td>

<td style="width: 12.5%; height: 22px;">Active</td>

<td style="width: 13.8247%; height: 22px;">Reachable</td>

<td style="width: 7.37666%; height: 22px;">19.03.11</td>

</tr>

<tr style="height: 22px;">

<td style="width: 12.5%; height: 22px;">kch2n7afiuvi7cry98biz6332</td>

<td style="width: 12.5%; height: 22px;">p2</td>

<td style="width: 12.5%; height: 22px;">Ready</td>

<td style="width: 12.5%; height: 22px;">Active</td>

<td style="width: 13.8247%; height: 22px;">Reachable</td>

<td style="width: 7.37666%; height: 22px;">19.03.11</td>

</tr>

<tr style="height: 22px;">

<td style="width: 12.5%; height: 22px;">b0hgrd23guaif81ipl39iysf8</td>

<td style="width: 12.5%; height: 22px;">p3</td>

<td style="width: 12.5%; height: 22px;">Ready</td>

<td style="width: 12.5%; height: 22px;">Active</td>

<td style="width: 13.8247%; height: 22px;"></td>

<td style="width: 7.37666%; height: 22px;">19.03.11</td>

</tr>

<tr style="height: 22px;">

<td style="width: 12.5%; height: 22px;">nl4hlfi7qsdljilw6j21q0be4</td>

<td style="width: 12.5%; height: 22px;">p4</td>

<td style="width: 12.5%; height: 22px;">Ready</td>

<td style="width: 12.5%; height: 22px;">Active</td>

<td style="width: 13.8247%; height: 22px;"></td>

<td style="width: 7.37666%; height: 22px;">19.03.11</td>

</tr>

<tr style="height: 22px;">

<td style="width: 12.5%; height: 22px;">15kmve4bm3x7z7e1yz2h3pw4a</td>

<td style="width: 12.5%; height: 22px;">* pi0</td>

<td style="width: 12.5%; height: 22px;">Ready</td>

<td style="width: 12.5%; height: 22px;">Active</td>

<td style="width: 13.8247%; height: 22px;">Leader</td>

<td style="width: 7.37666%; height: 22px;">19.03.11</td>

</tr>

</tbody>

</table>

</p>

<h2>Let's do something with it</h2>

<p>Now you've built your lovely Docker Swarm you'll want to run a service on it. You could install <a href="https://github.com/dockersamples/docker-swarm-visualizer" target="_blank">Visualizer</a> but it doesn't do a lot other than give you a visual overview of what containers and services you have. I like <a href="https://www.portainer.io/" target="_blank">Portainer</a>, not only does it give you full control but also in-depth information as well as including, yes, visualizer.</p>

<p>On our Host machine (In my case pi0) do:</p>

<p><pre class="ga gb gc gd ge jn jo jp">curl -L https://downloads.portainer.io/portainer-agent-stack.yml -o portainer-agent-stack.yml</pre></p>

<p>I'd love to talk to you about .yml which is used by <a href="https://www.ansible.com/" target="_blank" rel="noopener noreferrer">Ansible</a> for playbooks but that's for another day.</p>

<p>Next we'll deploy Portainer in our Swarm:</p>

<p><pre class="ga gb gc gd ge jn jo jp">docker stack deploy --compose-file=portainer-agent-stack.yml portainer</pre></p>

<p>Wait a few moments for the service to propagate across your cluster (it's literally seconds) and then in the browser of your choice type the ip address with port 9000 for your host (pi0) in my case 192.168.1.18:9000</p>

<p>You will be asked to set an Admin password and will then be logged in. It took a few moments for the information of the cluster to be probed by Portainer but eventually we were happy bunny's.</p>

<p><center>https://www.cannon-linux.co.uk/wp-content/uploads/2020/06/Screenshot-from-2020-06-02-14-30-00.png</center></p>

<center>https://steemitimages.com/DQmaGiJ5Exn5zL4cJEFVahrn96ozJ8bVTWeXhqznp28SYy2/19.png</center>

<center><em>"If you don't have enough voting power or crypto to upvote me; reshare me instead. Reshares are worth their weight in gold!"</em></center>

<hr>

<p>My actual name is Pete</p>

<p>Find out <a href="https://www.cannon-linux.co.uk/2009/04/dick_turpn_why_/" target="_blank">Here</a> why I have the username dick_turpin.</p>

<hr>

<h4>Find me on Social Media</h4>

<table width="18%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="4%"><img src=https://steemitimages.com/DQmTxSFtU3Y9Fi6Um2295WaQtK5d9gAopnpcWKEFMXWk2Hc/Mastodon24.png/></td>

<td width="96%" nowrap><a href="https://mastodon.org.uk/@dick_turpin" target="_blank">https://mastodon.org.uk/@dick_turpin</a></td>

</tr>

<tr>

<td width="4%">

<img src=https://cdn.steemitimages.com/DQmP3KmtuyC2NzXCHQP122rbWVaoYGaeNgPhVzGKqqAziNz/Twitter50.png>

</td>

<td width="96%" nowrap><a href="https://twitter.com/dick_turpin" target="_blank">https://twitter.com/dick_turpin</a></td>

</tr>

<tr>

<td width="4%"><img src=https://steemitimages.com/DQmY7uALV3NdtKQRu6BiNWVRCkvo4a1e9ob9A8bQGhUkxWB/Facebook24.png/></td>

<td width="96%" nowrap><a href="https://www.facebook.com/peter.cannon3" target="_blank">https://www.facebook.com/peter.cannon3</a></td>

</tr>

</table>

<hr>

<p>This work is licensed under a <a rel="license" href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.<br /><b>License explained:</b><a href="https://creativecommons.org/share-your-work/licensing-types-examples" target="_blank"> Examples</a><br /><b>Create your license:</b><a href=https://creativecommons.org/choose" target="_blank"> Choose</a></p>

<div class="pull-left">

<center>

<a rel="license" href="https://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons Licence" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a>

</center>

</div>

<br /><br /><sup>Podcaster. FOSS, Linux & Creative Commons Advocate.<br />

"Be who you are and say what you feel because those who mind don't matter and

those who matter don't mind."</sup>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 1081 others
properties (23)
post_id86,253,950
authordickturpin
permlinkcluster-hat-with-docker-swarm
categoryclusterhat
json_metadata{"tags":["docker","portainer","rasperrypi"],"image":["https:\/\/www.cannon-linux.co.uk\/wp-content\/uploads\/2020\/06\/Pi_Featured_image.png","https:\/\/www.cannon-linux.co.uk\/wp-content\/uploads\/2020\/06\/clusterhat_portainer-146x300.jpg","https:\/\/files.peakd.com\/file\/peakd-hive\/dickturpin\/ucaETKIV-USB3-2.png","https:\/\/files.peakd.com\/file\/peakd-hive\/dickturpin\/LST8EvS8-circle-warn.png","https:\/\/www.cannon-linux.co.uk\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-02-14-30-00.png","https:\/\/steemitimages.com\/DQmaGiJ5Exn5zL4cJEFVahrn96ozJ8bVTWeXhqznp28SYy2\/19.png","https:\/\/steemitimages.com\/DQmTxSFtU3Y9Fi6Um2295WaQtK5d9gAopnpcWKEFMXWk2Hc\/Mastodon24.png","https:\/\/cdn.steemitimages.com\/DQmP3KmtuyC2NzXCHQP122rbWVaoYGaeNgPhVzGKqqAziNz\/Twitter50.png","https:\/\/steemitimages.com\/DQmY7uALV3NdtKQRu6BiNWVRCkvo4a1e9ob9A8bQGhUkxWB\/Facebook24.png","https:\/\/i.creativecommons.org\/l\/by\/4.0\/88x31.png"],"links":["https:\/\/clusterhat.com\/","https:\/\/www.cannon-linux.co.uk\/2014\/08\/frankenpi-part-1\/","https:\/\/docs.docker.com\/engine\/swarm\/","https:\/\/get.docker.com","https:\/\/github.com\/dockersamples\/docker-swarm-visualizer","https:\/\/www.portainer.io\/","https:\/\/downloads.portainer.io\/portainer-agent-stack.yml","https:\/\/www.ansible.com\/","https:\/\/www.cannon-linux.co.uk\/2009\/04\/dick_turpn_why_\/","https:\/\/mastodon.org.uk\/@dick_turpin","https:\/\/twitter.com\/dick_turpin","https:\/\/www.facebook.com\/peter.cannon3","https:\/\/creativecommons.org\/licenses\/by\/4.0\/","https:\/\/creativecommons.org\/share-your-work\/licensing-types-examples","https:\/\/creativecommons.org\/choose"],"app":"steemit\/0.2","format":"markdown"}
created2020-06-06 09:48:42
last_update2020-06-06 09:50:39
depth0
children1
net_rshares2,922,211,031,345
last_payout2020-06-13 09:48:42
cashout_time1969-12-31 23:59:59
total_payout_value0.822 SBD
curator_payout_value0.709 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length15,110
author_reputation6,041,031,650,451
root_title"Cluster Hat with Docker Swarm"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1145)
@steevc ·
$0.07
Wow, multiple nested frames!

Less and less people using Steem, but if you can make something then go for it. The auto-vote most people used has shut down and lots of us have powered down, so votes are worth less. I'll be more or less out in 2 weeks.
👍  ,
properties (23)
post_id86,258,618
authorsteevc
permlinkre-dickturpin-qbiurc
categoryclusterhat
json_metadata{"tags":["clusterhat"],"app":"steempeak\/2020.05.1"}
created2020-06-06 20:40:24
last_update2020-06-06 20:40:24
depth1
children0
net_rshares166,060,608,488
last_payout2020-06-13 20:40:24
cashout_time1969-12-31 23:59:59
total_payout_value0.035 SBD
curator_payout_value0.035 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length250
author_reputation273,317,013,544,223
root_title"Cluster Hat with Docker Swarm"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (2)