NVME Drive Keep Alive Script

Placed in /Scripts/keepalive

 pi@raspberry01:~/Scripts/keepalive$ cat keepalive.sh 
 #bin/bash
 
## BAINWERX
## NVME Keepalive Read|Write Script
## version 1.2
## created Feb 2021

## Time in 12 hr format
 logging_time=$(date +'%r')
 
## backup dir format
 logging_dir=$(date +'%m_%d_%Y')
 
find /home/pi/Scripts/keepalive/*.log -mtime 1 -delete;
 echo "NVME Keepalive Read|Write at" "${logging_time}" >> /home/pi/Scripts/keepalive/"${logging_dir}".log 

Runing this script will create a .log file with a simple write to the nvme drive. Next step wil be to setup a cron task with

sudo crontab -e

add the following lines to enable the script

# nvme drive keepalive by posting to drive every minute
 */1 * * * * sudo sh /home/pi/Scripts/keepalive/keepalive.sh

Now Save and reboot the system.

NOTE

If you are adding this with pihole…you might want to add the following step which will run when the pi is rebooted. It tells the pi that when it reboots…wait 15 seconds and then restart the pihole dns resolution

# On reboot + 15 seconds restart the pihole dns resolver (loop prevention)
 
@reboot sleep 15 && sudo pihole restartdns

Cluster Management with Ansible

Now that I have my “base cluster” up and running with ProxMox, it’s time to turn my attention to how I’m going to manage it.

After creating a new management user I setup ssh certs to permit ssh traffic from the master to slave systems.

Instalation of Ansible was a breeze

$ sudo apt update
$ sudo apt install software-properties-common
$ sudo apt-add-repository --yes --update ppa:ansible/ansible
$ sudo apt install ansible

After creating an inventory file, and then a quick and dirty playboook...I tested it out and...

voila!

First run went smashing..although it showed that there WAS actually an update or two on 2/3 of the servers.

After running my playbook again it looks like everything was in fact in order.

Ubuntu 20.10 Server Virtualization Challenges

===============================================================

Issue #1 – IP Address not configured correctly

The fix

sudo rm /etc/machine-id
sudo systemd-machine-id-setup
sudo reboot

as per https://jaylacroix.com/fixing-ubuntu-18-04-virtual-machines-that-fight-over-the-same-ip-address/

===============================================================

Issue #2 – Time Sync (aka NTP Server / Client Config)

The fix

setup ntp server on ubuntu01

setup ntp client on ubuntu02 through ubuntu04

as per https://vitux.com/how-to-install-ntp-server-and-client-on-ubuntu/

===============================================================

Issue #3 – Time / Date Appearance

The fix – simple reconfiguration as per https://linuxize.com/post/how-to-set-or-change-timezone-on-ubuntu-18-04/