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 1/4] 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. From 41ee154d2ce7fcd1170cc2a343b12875fa802df2 Mon Sep 17 00:00:00 2001 From: asche <47307281+asche77@users.noreply.github.com> Date: Thu, 8 Apr 2021 21:38:46 +0200 Subject: [PATCH 2/4] Update INSTALL.md Add installation instructions for OmniOS; cleaned up description somewhat. --- INSTALL.md | 88 +++++++++++++++++++++++------------------------------- 1 file changed, 38 insertions(+), 50 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index dd65501..72fed7b 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -171,10 +171,9 @@ 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. +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 @@ -184,83 +183,72 @@ 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 +# 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!): +pfexec perl -MCPAN -e shell + install CPAN ## update CPAN + reload cpan ## reload -```# 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 + 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 ``` -2. Download the Sanoid repo: +2. Download and clone the Sanoid repo: ``` -# do this as root # install git pfexec pkg install git -# Download the repo as root to avoid changing permissions later + +# Tip: 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) + +# patch syncoid, so that it correctly recognises the "zfs resume" capability under OmniOS (see 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 + +# most likely not required, but make the executables eXecutable +pfexec chmod +x sanoid syncoid findoid sleepymutex + +# Install the executables into /opt/sanoid 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 + +# add symbolic links to executables to a directory in $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: +3. Create the config directory /etc/sanoid, put default sanoid files there, and create and edit sanoid.conf: ```# Create the config directory pfexec mkdir /etc/sanoid -# Install default config -pfexec cp sanoid.defaults.conf /etc/sanoid + +# Copy default config and sample config +pfexec cp sanoid.defaults.conf sanoid.conf /etc/sanoid/sanoid.example.conf + # 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): +## and edit it (using e.g. 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" +Further steps (not OmniOS specific): +- set up SSH connections between two remote hosts +- create a cron job that runs sanoid --cron --quiet periodically ## Other OSes From b1c2bcf8596f051b06c0aee8eadffebbf750f292 Mon Sep 17 00:00:00 2001 From: asche <47307281+asche77@users.noreply.github.com> Date: Thu, 8 Apr 2021 21:40:51 +0200 Subject: [PATCH 3/4] Update INSTALL.md --- INSTALL.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 72fed7b..cd3c768 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -9,6 +9,7 @@ - [CentOS](#centos) - [FreeBSD](#freebsd) - [Alpine Linux / busybox](#alpine-Linux-busybox-based-distributions) + - [OmniOS](#OmniOS-Illumos-based-distributions) - [Other OSes](#other-oses) - [Configuration](#configuration) - [Sanoid](#sanoid) @@ -177,7 +178,8 @@ Used with OmniOS r34, r36 and r37 (with napp-it installed). Hence, we presume y 1. Install prerequisites: Perl module Config::IniFiles, ssh, pv, gzip, lzop, and mbuffer -```# install/update standard programs +```bash +# install/update standard programs pfexec pkg install openssh gzip mbuffer pipe-viewer # include OpenCSW repository @@ -205,7 +207,7 @@ pfexec perl -MCPAN -e shell 2. Download and clone the Sanoid repo: -``` +```bash # install git pfexec pkg install git @@ -234,7 +236,8 @@ pfexec ln -s /opt/sanoid/sanoid /usr/bin/sanoid & pfexec ln -s /opt/sanoid/synco ``` 3. Create the config directory /etc/sanoid, put default sanoid files there, and create and edit sanoid.conf: -```# Create the config directory +```bash +# Create the config directory pfexec mkdir /etc/sanoid # Copy default config and sample config From 876685a636492d58c237ddd1b7b9cab2d256ec24 Mon Sep 17 00:00:00 2001 From: asche <47307281+asche77@users.noreply.github.com> Date: Thu, 8 Apr 2021 21:41:45 +0200 Subject: [PATCH 4/4] Update INSTALL.md --- INSTALL.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index cd3c768..d401179 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -8,8 +8,8 @@ - [Debian/Ubuntu](#debianubuntu) - [CentOS](#centos) - [FreeBSD](#freebsd) - - [Alpine Linux / busybox](#alpine-Linux-busybox-based-distributions) - - [OmniOS](#OmniOS-Illumos-based-distributions) + - [Alpine Linux / busybox](#alpine-Linux-or-busybox-based-distributions) + - [OmniOS](#OmniOS) - [Other OSes](#other-oses) - [Configuration](#configuration) - [Sanoid](#sanoid) @@ -165,14 +165,14 @@ pkg install p5-Config-Inifiles p5-Capture-Tiny pv mbuffer lzop * See note about mbuffer and other things in FREEBSD.readme -## Alpine Linux / busybox based distributions +## Alpine Linux or busybox based distributions The busybox implementation of ps is lacking needed arguments so a proper ps program needs to be installed. For Alpine Linux this can be done with: `apk --no-cache add procps` -## OmniOS / Illumos based distributions +## OmniOS Used with OmniOS r34, r36 and r37 (with napp-it installed). Hence, we presume you have a standard perl installation etc.