Zync

Status
Not open for further replies.

Omry Yadan

Cadet
Joined
Sep 12, 2016
Messages
6
Hi all,
I am migrating from OpenIndiana (Yay!), so far I am impressed by how easily things are moving along.
Setup was overall very easy (except the part where I didn't realize I can't just boot from the Installation USB and I need another one to install onto.
The installation process was not immediately obvious to me, initially I thought I would boot from the USB and add the disks to the ZFS from there, which led me to install FreeNAS on all 6 disks :).
Later I realize the right way to go is to install it onto a second USB and than boot from that one.
the process seems a bit redundant, why not just provide the image for the second USB in the first place?

Anyway, a few years ago (2009, time files!) - I wrote a little utility that combines ZFS snapshots with Rsync called Zync (ZFS + Rsync = Zync, the descirption and documentaiton is on the link).
The idea is that cron run Zync every day, it will use rsync over ssh to backup remote servers to a specific directory for each server
and then takes a zfs snapshot of that directory.
this way you get a daily snapshots of your remote server, each one takes pretty much only the delta from the first snapshot.
in addition, Zync supports include and exclude directories per server, snapshot retention policy (how many days to keep), and inplace inplace writing (rsync --inplace) which minimize writes and thus makes the snapshot more efficient.

Looking at the Rsync support in FreeNAS, this combination of features does not exactly seems available (correct me if I am wrong).

I would like to get Zync to run in FreeNAS and I am not sure what is the right way to do it.
if in the process I can make it something that is easily usable to someone else (like a plugin maybe) that would be cool as well.
The dependencies for it is a JVM (it's written in Java), rsync and zfs binaries.

I am not sure a a jailed program will be able to access the host zfs pools.
any hints or help on getting this done will be appreciated.
 
Last edited:

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
The dependencies for it is a JVM (it's written in Java), rsync and zfs binaries.
I am not sure a a jailed program will be able to access the host zfs pools.
any hints or help on getting this done will be appreciated.
You should be able to install a JVM in a jail, rsync and zfs will be available out of the box, then use the GUI Add Storage button to make pool storage available to the jail.
 

Omry Yadan

Cadet
Joined
Sep 12, 2016
Messages
6
Hi Robert,
Thanks for the answer.
I added storage to my jail, and while I can access the file system in the jail, running zfs results in :

root@zync:/ # zfs list
no datasets available

I need to be able to take snapshots on the datasets, so it does not look like this is a good enough solution.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Why not just use replication?

I forget how but you need to give the jail zfs rights. It's disabled because you wouldn't want someone in a jail being able to delete a dataset.

Sent from my Nexus 5X using Tapatalk
 

Omry Yadan

Cadet
Joined
Sep 12, 2016
Messages
6
Why not just use replication?

I forget how but you need to give the jail zfs rights. It's disabled because you wouldn't want someone in a jail being able to delete a dataset.

Sent from my Nexus 5X using Tapatalk

I don't have ZFS on the other hand, so replication is not an option.
I am backing up Linux boxes with it.

I will dig around to see how to give zfs rights to the jail.
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
I don't think the jail will be able to use the ZFS command, but once you installed whatever you needed in the jail, you can run and access those files from outside the jail.
 

Omry Yadan

Cadet
Joined
Sep 12, 2016
Messages
6
I will give it a shot, but this sounds very close to just run it directly on freenas.
What are the advantages of using a jail in this case (besides that point that for some reason, maybe by design - it does not appear possible to install packages in freenas outside of a jail).
 

Omry Yadan

Cadet
Joined
Sep 12, 2016
Messages
6
Java doesn't really like being executed from outside the chroot, it can't find some things.
Code:
[root@iron] ~# /mnt/storage/jails/zync/usr/local/bin/javavm
javavm: warning: The use of 'javavm' as a synonym for 'java' is deprecated
java: error: can't find /usr/local/etc/javavms configuration file
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
You don't install tools to freenas. You install and run it in a jail.

Sent from my Nexus 5X using Tapatalk
 

Omry Yadan

Cadet
Joined
Sep 12, 2016
Messages
6
I looked around and couldn't find documentation for how to enable zfs access from a jail.
I found some posts here and there that give some details, but non of them was freenas specific and I was not sure how to do some of the steps (I am new to FreeBSD).
at this point I am tempted to copy a JVM directly into freenas to run zync, obviously this is far from ideal and I would really like to find a proper solution.
 
Status
Not open for further replies.
Top