mercredi 25 mai 2022

SSH keys

Continued to create ssh keys (one per environment) for my personal account on the 3 K8s servers.  Used ssh-keygen (with default parameters) and ssh-copy-id to copy the public key to all the workers.  So now I can login from the master to any of the workers on each cluster.  That's so many less password typing/pasting.

vendredi 5 février 2021

Reinstall Linux on the Dell laptop

Goal is to test the Linux Mint upgrade (from 20.x to 21.xx).  But I first tried installing Fedora.  However the out-of-the-box install couldn't cope with the Broadcom wi-fi interface so I quickly gave up on that one.  I installed from the same Linux Mint as what I have used on the Medion laptop (I think 20.04).  Worked like a charm but I had to install the firmware-b43-installer (and required b43-fwcutter) to support said wi-fi interface.

Then added darktable (from the apt repo: 3.0 only so I got 3.4.0 from Software Manager instead).  Also added rapid-photo-downloader and all its prerequisites.

So:

sudo apt install firmware-b43-installer

sudo apt install rapid-photo-downloader

sudo apt install autofs

sudo vi /etc/auto.master

sudo service autofs restart

Also, renamed the host to "run12l" (the prior hostname when running under Ubuntu):

sudo vi /etc/hostname

sudo vi /etc/hosts

Then also reinstalled the urbackup client (via the server's web interface "download client" link, not from the internet -- because this allows the client certificate from the old client to work with the server, so we can restore old files that were backed up prior to the OS change).  By the way to enable restore with the web interface, it is necessary -- after install -- to edit /etc/default/urbackupclient and set option 

RESTORE="server-confirms"

Please note that the quotes are required in that line.  Then reboot or use

sudo service urbackupclientbackend restart

mardi 15 décembre 2020

New M2.2280 SSD

Installed a 2nd 512GB SSD in the laptop.  Easy peasy.  After a week or so, rebooted in single user mode and unmounted it, then cleanup of the underlying old "/home" directory, then restarted again (thus reclaimed a few dozen GB from the first SSD).

lundi 30 novembre 2020

Databases "hot" backup : PostgreSQL

I hadn't installed Postgres in a while and apparently my current software stack doesn't require it.  So I first had to install from the repos:

sudo apt-get install postgresql

I loaded some sample data using a tutorial available from https://www.postgresqltutorial.com/load-postgresql-sample-database.  However I had to fix the "CREATE DATABASE" statement in this file, apparently the codepage 1252 is specified (Windows) and my Linux Mint PostgreSQL didn't like it.  So :

  • CREATE DATABASE dvdrental WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'English_United States.1252' LC_CTYPE = 'English_United States.1252';
was replaced by:
  • CREATE DATABASE dvdrental WITH TEMPLATE = template0 ENCODING = 'UTF8';

The pg_dumpall command is supposedly able to backup everything.  Trying manually first:

  • sudo -u postgres pg_dumpall -f /var/tmp/postgres.backup.`date +%Y%m%d_%H%M%S`.psql
That worked fine, so added it in postgres's crontab:
$ sudo mkdir /var/backups/postgres
$ sudo chown postgres:postgres /var/backups/postgres
$ sudo crontab -lu postgres
# m h  dom mon dow   command
50 16 * * *  pg_dumpall -f /var/backups/postgres/postgres.backup.`date +%Y%m%d_%H%M%S`.psql
Well now that doesn't work anymore, for some reason the datestamp part of the command doesn't work quite right under cron.  So I wrote a short script to do it:
$ more dailybackup.sh
#! /bin/sh

pg_dumpall -f /var/backups/postgres/postgres.backup.`date +%Y%m%d_%H%M%S`.psql

That's OK now.

$ sudo crontab -lu postgres
# m h  dom mon dow   command
10 17 * * * /home/luc/Projects/dvdrentals/dailybackup.sh
$ ls -l /var/backups/postgres
total 96
-rw-rw-r-- 1 postgres postgres 45710 nov.  30 17:06 postgres.backup.20201130_170614.psql
-rw-rw-r-- 1 postgres postgres 45710 nov.  30 17:10 postgres.backup.20201130_171001.psql

 

lundi 23 novembre 2020

/var was still too small...

 

So : 

mkdir  /var/backups/urbackup/tmp

chown urbackup:urbackup  /var/backups/urbackup/tmp

Then in  /etc/default/urbackupsrv :

 DAEMON_TMPDIR="/var/backups/urbackup/tmp"


Current disks installed in backup server

sda

  • small 150GB Hitachi system disk
  • includes root, swap and /var partitions
  • Linux should be able to boot from just this disk
luc@kid2:~$ sudo fdisk -l /dev/sda
Disk /dev/sda: 149,5 GiB, 160041885696 bytes, 312581808 sectors
Disk model: Hitachi HDP72501
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x676b6100

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1  *           63  25173854  25173792   12G 27 Hidden NTFS WinRE
/dev/sda2        25174016 193069055 167895040 80,1G 83 Linux
/dev/sda3       193071104 201860166   8789063  4,2G 82 Linux swap / Solaris
/dev/sda4       233072640 312581807  79509168 37,9G 83 Linux 

sdb

  • smallish 300GB Seagate system disk
  • used by a /home partition
  • any data remaining on this partition should probably migrate to the laptop (or external)
luc@kid2:~$ sudo fdisk -l /dev/sdb
Disk /dev/sdb: 298,9 GiB, 320072933376 bytes, 625142448 sectors
Disk model: ST320DM000-1BC14
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0008daeb

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdb1  *     2048 625141759 625139712 298,1G 83 Linux

sdc

  • 2TB Seagate system disk, recently installed
  • is BTRFS devid 2
  luc@kid2:~$ sudo fdisk -l /dev/sdc
Disk /dev/sdc: 1,84 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: ST2000DM001-1ER1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

sdd

  • 2TB HP system disk, recently reformatted
  • is BTRFS devid1
 luc@kid2:~$ sudo fdisk -l /dev/sdd
Disk /dev/sdd: 1,84 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: MB2000GDUNV
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

samedi 21 novembre 2020

Adding a second drive to BTRFS

luc@kid2:~$ sudo btrfs device add -f /dev/sdc /var/backups/urbackup/
luc@kid2:~$ sudo btrfs fi show
Label: none  uuid: 9c8025a0-5351-4807-b7ac-97ffa87ededa
        Total devices 2 FS bytes used 447.00GiB
        devid    1 size 1.82TiB used 450.02GiB path /dev/sdd
        devid    2 size 1.82TiB used 0.00B path /dev/sdc