The Power of Pi by mshallop

View this thread on steempeak.com
· @mshallop ·
The Power of Pi
I have been working with, programming, computers since 1980.  I still work as a software developer and, as a telecommuter, I have a fairly extensive networking set-up.  My development work causes me to focus primarily on back-end data-systems.  So, I have a lot of computers, all of which run Linux, ChromeOS, or Android OS, in order to meet various job requirements.

Recently, my power box, (where the main electrical line enters the house, because corroded resulting in a loss of ground and the neutral bar.  I live very close to the ocean and the salt air can reduce the lifetime of metal to just a few years.  As such, within the house, I began to notice problems with the power starting with flickering lights and battery-back-up machines complaining whenever I started the washing machine or dryer.

Sure enough, one day, the power-box called it quits.  According to my battery-back-up volt meter, my power surged from a normal 120v to a sustained 135 volts!

Any system I had that was fairly old - and I have a couple of them as I "re-cycle" older boxes and put them to work as linux database servers - pretty much died at this point, even though they were sitting behind a battery-back-up boxes and surge-protectors.  (You do know your surge protector you bought way back when is probably just junk now, right?  Like milk, they, too, expire over time.)

All told, I ended-up losing:
* a home-built PC with an I5 processor that I had built about 4-years ago and just recently converted it to Linux for gaming,  
* an HP-Compaq box I used as a data node server
* a Dell System-390 Optiplex - dual Xenon processors and 32Gb of memory (this one hurt)
* my microwave
* USB speakers attached to my main home box

Of all the boxes I lost, the Dell hurt the most - I used the multi-cpu, multi-core box to run several mongo instances, on different ports.  I also used it to host my [nextcloud](https://nextcloud.com/) server.   That one really hurt!  I had my whole life on my nextcloud!

Luckily, I was taking USB back-ups nightly of my data directory via cron.  My nextcloud repo, alone, was 3.9Gb of data!  (Like I said, my whole life...) and, thankfully the USB drive survived the power surge as I immediately cloned the last three copies of the back-up data to other systems.  Redundancy = good.

So, now I had to decide where to create a new nextcloud service... My daily System-76 laptop is limited to work-only so that's out.  I have two other laptops, both Dells, but I need the nextcloud service to be on continuously.  My daily-use (home) Linux server was still up, I wasn't comfortable using it to host my nextcloud service because I'm not-so-good at taking back-ups of this machine.

Then, since I also have about a half-dozen Raspberry Pi's laying around, why not do the installation on a pi?

Googling it, I found this [article](https://fredfire1.wordpress.com/2016/06/25/install-nextcloud-owncloud-fork-on-raspberry-pi2-raspberrypi2/) which explained how to install nextcloud-10 (the current release) on to a Raspberry Pi2.  I actually had an unused pi-3 floating about, so I grabbed it and started following the site's instructions.

One of the issues I was concerned about was the pi-installation of nextcloud was on sqllite whereas before I was using mysql server.   I didn't have a database back-up, per-se, but I had backed-up the data/ directory.  The doc clearly states that to recover, you need both the data/ files, and the database dump.  I had the former but not that latter.

I went ahead and followed most of the instructions in the article, installing the pi-light image (my first time installing a non-raspian OS...) and the LAMP back-end (PHP, Apache and SQL-lite.)  Since I've got experience installing nextcloud, this was fairly routine for me.  My pi is installed on my lan via ethernet, albeit the pi's slower 10gb/s ethernet, instead of wireless.

I extracted my data/ directory from the back-up tarball, and copied into the nextcloud repository and loaded the site in my browser.  Flickering yellow light on the pi-board and.... success!

What I find amazing, even after all these years, is that this transition from a dual-processing, multi-core, linux server running mysql, to a Raspberry-Pi3 with a 32Gb SDRAM card, running sql-lite, went so flawlessly!

I had all of my files back, with the exception of my calendar!  (Which I can import from google so, meh.)  All my photos, my books,  code,  everything!

Any concerns I had about performance were unfounded.  This little pi-3 is a beast!  I get some lag in loading new directories but one nextcloud caches new page hits, secondary hits are instant.   Since my pi-cloud is lan-limited, I'm not concerned about access-times from the cloud.  Also, it's not like I use the pi-cloud extensively -- my most-frequent updates are on the calendar -- but otherwise cloud access is relatively infrequent.

Consuming less than 2-watts, the pi-cloud is also economically advantageous over the previous (beast) host.   This is an important consideration as I live in a country where electrical rates are significantly higher than the US.   

Next steps - install a cron job to back-up the data/ directory to a nfs-mounted NAS-device.  I keep a 3TB FreeNAS partition available for ad-hoc jobs and my music files.  (All told, I have about 35Tb of raw NAS storage which translates down to almost 20Tb of RAID-backed store.)

All said, I'm happy with my replacement solution - I've apportioned an un-used pi to act as a replacement, albeit local, data service.  It's low-power consumption advantages offset the decreased processing and networking speeds for it's infrequent use.
👍  , ,
properties (23)
post_id983,903
authormshallop
permlinkthe-power-of-pi
categoryraspberry-pi
json_metadata"{"links": ["https://nextcloud.com/", "https://fredfire1.wordpress.com/2016/06/25/install-nextcloud-owncloud-fork-on-raspberry-pi2-raspberrypi2/"], "tags": ["raspberry-pi", "nextcloud", "self-hosting"]}"
created2016-09-18 15:19:15
last_update2016-09-18 15:19:15
depth0
children1
net_rshares472,412,648
last_payout2016-10-19 15:21:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length5,654
author_reputation0
root_title"The Power of Pi"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (3)
@jlitew ·
Sorry to hear you lost quite a bit of hardware there.. So even the 32GB of RAM was toast too huh?
properties (22)
post_id23,628,401
authorjlitew
permlinkre-mshallop-the-power-of-pi-20180105t001954852z
categoryraspberry-pi
json_metadata"{"app": "steemit/0.1", "tags": ["raspberry-pi"]}"
created2018-01-05 00:19:57
last_update2018-01-05 00:19:57
depth1
children0
net_rshares0
last_payout2018-01-12 00:19:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length97
author_reputation8,149,127,469
root_title"The Power of Pi"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000