RSync vs. ZFS snapshot Replication vs. Other- Over WAN

Status
Not open for further replies.

njxc500

Dabbler
Joined
Oct 10, 2011
Messages
11
Hello all,

I've got two FreeNAS boxes, both of which have more than 75 % disk space available. They are running FreeNAS-8.0-RELEASE-amd64 - and I'd like to find a different way to back up my data. Right now, I've got an external drive, which I copy and paste all the files to manually. I figure there is a much better way to do this. Without stabbing away at it and finding an option that works, I thought I'd ask the question here and start in the right direction first.

Is there a good way to have my two servers back up each other, over WAN?

Would I copy them to each other, and treat them as the same server, with one being primary and one being backup.

Would I use ZFS replication, snapshots, and how often. Any input on this would be great, I'm going to try to set this up soon.

Thanks.

Nick
 
Last edited by a moderator:

JaimieV

Guru
Joined
Oct 12, 2012
Messages
742
Do they already have some network connection, ie are the two sites joined by a bridge or VPN? If not, that's the first task - making them available to each other.

After that, the choice is yours. I'd probably go for scheduled rsyncs, and take regular snapshots locally (which is how I manage my same-LAN NAS boxes).
 

ternarybit

Cadet
Joined
Nov 6, 2012
Messages
6
Do they already have some network connection, ie are the two sites joined by a bridge or VPN? If not, that's the first task - making them available to each other.

Correct me if I'm wrong, but as I understand it, replication uses SSH to secure the transaction. Isn't VPN'ing the connection redundant, at least in terms of security? I'm not saying that a VPN between the servers wouldn't provide certain benefits, but I don't believe one is strictly necessary to replicate securely.
 

ternarybit

Cadet
Joined
Nov 6, 2012
Messages
6
Hello all,

I've got two FreeNAS boxes, both of which have more than 75 % disk space available. They are running FreeNAS-8.0-RELEASE-amd64 - and I'd like to find a different way to back up my data. Right now, I've got an external drive, which I copy and paste all the files to manually. I figure there is a much better way to do this. Without stabbing away at it and finding an option that works, I thought I'd ask the question here and start in the right direction first.

Is there a good way to have my two servers back up each other, over WAN?

Would I copy them to each other, and treat them as the same server, with one being primary and one being backup.

Would I use ZFS replication, snapshots, and how often. Any input on this would be great, I'm going to try to set this up soon.

Thanks.

Nick

You and I are interested in the same thing. I have not implemented / tested it personally, but from extensive research, it looks like replication is exactly what you want.

As I mentioned above, I understand that replication takes place over an SSH connection, and thus a VPN is not strictly necessary. This means that any two FreeNAS boxes can, properly configured, replicate to each other securely over the Internet.

The manual outlines this process, and it doesn't seem too difficult.

Rsync and replication have both their benefits and drawbacks. As I understand it, ZFS snapshots are very intelligent in that they only store bitwise differences between themselves. This is immensely helpful in the case of large files that may change slightly, like virtual machine hard disk files. With ZFS snapshots, only the changed bytes are saved, but with rsync, the entire virtual machine hard disk file will be backed up again if it changes. Edit: This is true, ZFS uses copy-on-write and is very, very efficient: https://en.wikipedia.org/wiki/ZFS#Snapshots_and_clones

The only major drawback to ZFS snapshots and replication that I can think of is that it relies on ZFS. But, in your case, you have two ZFS systems, so this is not an issue :)

In sum:

Based on extensive research and experience using rsync (actually, rsnapshot), it seems to me that the ideal offsite backup situation involves two nearly identical FreeNAS boxes, either configured as "master/slave," whereby the master pushes snapshots to the slave, or a bi-directional approach whereby both boxes exchange snapshots via replication.

I'm very eager to test this and will certainly report anything I find. Hope this helps, and I'm happy to help further if I can.
 
Last edited by a moderator:

guff666

Cadet
Joined
Jan 7, 2013
Messages
7
Slow response to this, but I'm investigating this myself.
The problem with using ZFS snapshots (AFAICS) is that you can't resume a send/recv transaction if it fails part-way through: e.g. due to a WAN failure.

Gareth
 

karlfife

Cadet
Joined
Apr 10, 2013
Messages
2
Based on extensive research and experience using rsync (actually, rsnapshot), it seems to me that the ideal offsite backup situation involves two nearly identical FreeNAS boxes, either configured as "master/slave," whereby the master pushes snapshots to the slave, or a bi-directional approach whereby both boxes exchange snapshots via replication.

Another reason to use rsync, is that it can function as an INDEPENDENT backup filesystem from the one on PUSH, complete with its very own independent snapshot/purge schedule (on PULL) This setup puts it a little closer to 'offline' in terms of the safety of your backup copy. For example, let's say you're the super-careful type, because your $5 Jillion company is on the line, and let's say this need drives you to ZFS replicate to TWO separate off-site locations. Now lets say you're human, and you fat-finger the deletion of a critical snapshot, or god forbid you blow them all away because you THOUGHT you were looking at a test machine. BOOM. So much for ALL of your backups! The main idea here is that ANY system, no matter how safe is unsafe if it has ANY single point failure mode, human or otherwise.
 

Osiris

Contributor
Joined
Aug 15, 2013
Messages
148
bi-directional approach whereby both boxes exchange snapshots via replication.
Hop, four years beyond, to FreeNAS 11.
Is there any way to use bidirectional replication of zfs datasets?
I haven't found out how to let boxes actually do this 'exchange' of snapshots...
 
Last edited by a moderator:

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
No, it's not supported by ZFS.
 

JayG30

Contributor
Joined
Jun 26, 2013
Messages
158
What do you mean by "bi-directional replication of snapshots"?

There is nothing stopping someone from replication independent dataset snapshots between two ZFS servers. For instance, I have two ZFS servers at 2 sites and they both use each other as replication targets for their specific data.

If bi-directional replication means something like Microsoft DFS, then no.
 

Osiris

Contributor
Joined
Aug 15, 2013
Messages
148
I meant something like syncthing does for folders.
I did in the meantime change my setup to syncthing & omitted the use of datasets and/or zvols.
 

Scampicfx

Contributor
Joined
Jul 4, 2016
Messages
125
Slow response to this, but I'm investigating this myself.
The problem with using ZFS snapshots (AFAICS) is that you can't resume a send/recv transaction if it fails part-way through: e.g. due to a WAN failure.

Gareth

Dear Gareth,

thanks for this valuable information.

In this case, it seems the replication feature would be a no-go for unreliable WAN-connections (e.g. 24h disconnect / renewal of ip). Are there any options to resume transfers in FreeNAS 11, when a replication gets interrupted by a few seconds / minutes?
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Resumable send/recv is already in ZFS. I'm not sure the GUI is taking advantage of it yet, though.
 

Scampicfx

Contributor
Joined
Jul 4, 2016
Messages
125
Dear Ericloewe,

thanks for your posting.

What happens right now when a SEND/RECV transaction is interrupted? Will the transaction start from scratch again or is this data of this transaction "lost"?

Or is it similar to transmitting TCP packets? => E.g. SEND/RECV transactions are splitted into "packets" and lost packets get resent, so that every transaction receives an ACK?

Thanks :)
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Resumable send/recv operates by having recv generate a token that send can use to determine where to resume sending.
 
Status
Not open for further replies.
Top