devnull

I've been a Linux Mercenary for quite a while now, often using information posted by kind strangers on the Internet to solve problems during this journey. The real strength of Linux lies within its community and this blog is a humble attempt to give something back to these wonderful people. If by any chance I helped with sorting out your problem please consider funding a cup of espresso to get me going with BTC 1DXKjB9isvdLwRy6ABsRSZvVGxzqCvbrXy Thank you.

Jun 162017
 

Been searching for a tool to streamline ZFS replication between my storage arrays and I think I found it – it’s called syncoid.

Installation

# ubuntu
apt install pv lzop mbuffer libconfig-inifiles-perl git -y
# centos
yum install pv lzop mbuffer perl-Config-IniFiles.noarch git -y


cd /usr/src/
git clone https://github.com/jimsalterjrs/sanoid.git
cp sanoid/syncoid /usr/local/sbin/

Now setup SSH keys for passwordless root login and setup cronjob to fire up /usr/local/sbin/replication-syncoid.sh once a day/week/whenever suits you.

0 0 * * 1   /usr/local/sbin/replication-syncoid.sh|logger

Where /usr/local/sbin/replication-syncoid.sh is

#!/bin/bash
FILESYSTEMS="apps home service vmfs"
LOG=/var/log/wigry-syncoid.log
for i in $FILESYSTEMS; do 
echo "---------------  `date` - syncing $i -------------" >> $LOG 2>&1 
/usr/local/sbin/syncoid -r [email protected]:tank/$i cistern/$i >> $LOG 2>&1
echo "---------------  `date` - done $i -------------" >> $LOG 2>&1
done

It gets the job done nicely and saves me from writing my own bash-perl-voodoo-black-magic-fuckery.

Thanks Jim.

Jun 132017
 

This is a funny one. Well, if you find this kind of thing funny.

After completing “yum update” on Centos 7.3 box I started getting this error every time I tried to use yum

yum AttributeError: 'list' object has no attribute 'encode'

 

I poked around and it turned out that it was incompatible version of Spacewalk agent (or rather its components) so in order to get yum working again I had to run this:

 

rpm -e rhn-check rhn-setup rhnsd yum-rhn-plugin

Now yum should be working again and I’m on the hunt for the newer version of rhn-* packages.

Yeah. It’s not immediately clear from error message so took me a moment to figure this out.