From a61808d3bf3f24dcf99424c5640fdce8ff54f507 Mon Sep 17 00:00:00 2001 From: asche <47307281+asche77@users.noreply.github.com> Date: Sun, 4 Apr 2021 12:28:21 +0200 Subject: [PATCH] Update INSTALL.md --- INSTALL.md | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/INSTALL.md b/INSTALL.md index c8411d3..dd65501 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -171,6 +171,97 @@ For Alpine Linux this can be done with: `apk --no-cache add procps` + +## OmniOS / Illumos based distributions + +Used with OmniOS r34, r36 and r37 with napp-it installed. Hence, we presume you have a standard perl installation etc. + +1. Install prerequisites: Perl module Config::IniFiles, ssh, pv, gzip, lzop, and mbuffer + +```# install/update standard programs +pfexec pkg install openssh gzip mbuffer pipe-viewer + +# include OpenCSW repository +pfexec pkg set-publisher -G '*' -g https://sfe.opencsw.org/localhostomnios localhostomnios + +# install LZOP from OpenCSW +pfexec pkg install lzop + +# install Perl modules +# do this as root +perl -MCPAN -e shell + +install CPAN ## update CPAN +reload cpan ## reload + +install inc::latest ## not sure if required +install IO::Scalar ## not sure if required +install Config::IniFiles +install Capture::Tiny +install Data::Dumper ## not sure if required, may be installed already +install File::Path ## not sure if required, may be installed already +install Getopt::Long ## not sure if required +install Pod::Usage ## not sure if required +install Time::Local ## not sure if required +exit +``` +Optionally, to update your perl installation (use with care!): + +```# OPTIONALLY install cpanm (CPAN Minus) and cpan-outdated +# do this as root +curl -L http://cpanmin.us | perl - --sudo App::cpanminus +/usr/perl5/5.32/bin/cpanm App::cpanoutdated +# update using cpanm / cpan-outdated +# do this as root +/usr/perl5/5.32/bin/cpan-outdated -p | /usr/perl5/5.32/bin/cpanm +``` + +2. Download the Sanoid repo: + +``` +# do this as root +# install git +pfexec pkg install git +# Download the repo as root to avoid changing permissions later +pfexec git clone https://github.com/jimsalterjrs/sanoid.git +cd sanoid +# checkout latest stable release or stay on master for bleeding edge stuff (but expect bugs!) +pfexec git checkout $(git tag | grep "^v" | tail -n 1) +# patch syncoid re: regexp check for zfs resume (https://github.com/jimsalterjrs/sanoid/issues/554) + << $avail{'sourceresume'} = system("$sourcessh $resumechkcmd $srcpool 2>/dev/null | grep '\\(active\\|enabled\\)' >/dev/null 2>&1"); + >> $avail{'sourceresume'} = system("$sourcessh $resumechkcmd $srcpool 2>/dev/null | grep -E '^(active|enabled)' >/dev/null 2>&1"); + << $avail{'targetresume'} = system("$targetssh $resumechkcmd $dstpool 2>/dev/null | grep '\\(active\\|enabled\\)' >/dev/null 2>&1"); + >> $avail{'targetresume'} = system("$targetssh $resumechkcmd $dstpool 2>/dev/null | grep -E '^(active|enabled)' >/dev/null 2>&1"); +# Install the executables +pfexec mkdir /opt/sanoid +pfexec cp sanoid syncoid findoid sleepymutex /opt/sanoid +# link executables to path +pfexec ln -s /opt/sanoid/sanoid /usr/bin/sanoid & pfexec ln -s /opt/sanoid/syncoid /usr/bin/syncoid & pfexec ln -s /opt/sanoid/findoid /usr/bin/findoid & pfexec ln -s /opt/sanoid/sleepymutex /usr/bin/sleepymutex +``` + +3. Create the config directory /etc/sanoid and put sanoid.defaults.conf in there, and create sanoid.conf in it too: +```# Create the config directory +pfexec mkdir /etc/sanoid +# Install default config +pfexec cp sanoid.defaults.conf /etc/sanoid +# Create a blank config file +pfexec touch /etc/sanoid/sanoid.conf +# Place the sample config in the conf directory for reference +pfexec cp sanoid.conf /etc/sanoid/sanoid.example.conf +## ... and do not forget to edit the empty(!) sanoid.conf file! (we are using nano as editor): +pfexec nano /etc/sanoid/sanoid.conf +``` + +4. Set up SSH connections between two remote hosts + + # missing !!!!!!!!!!!!!!!! + +5. Create a cron job or a systemd timer that runs sanoid --cron once per [every 30 min] + + # missing !!!!!!!!!!!!!!!! + + napp-it --> Jobs --> Other --> Create Other Job "/usr/bin/sanoid --cron --quiet" + ## Other OSes **Sanoid** depends on the Perl module Config::IniFiles and will not operate without it. Config::IniFiles may be installed from CPAN, though the project strongly recommends using your distribution's repositories instead.