Replicating data between 2 FreeNAS installs

Randy_ICS

Cadet
Joined
Sep 14, 2017
Messages
5
I've used FreeNAS in the past but this is the first time I'm trying to replicate data between 2 instances and am using the latest version (FreeNAS-11.0-U3) available for download.

I was able to get rsync working and pulling the data from one box to the other using the built in module, however I haven't been able to find an easy way to monitor synchronization between the two which is critical for what I am trying to do and it doesn't seem to email out alerts of it can't sync (I was testing by shutting down the server that rsync was pulling from).

I've been searching google and this forum for a suitable answer and although I've seen a lot of the threads regarding rsync, either they don't have any responses or don't answer my questions well.

I am looking to either find an easy way to verify the synced data, or preferably get email notifications of success/failures of synchronization. I'd prefer not to have to manually log into the server via ssh to check logs or run commands if possible, the more automated this is the better as I can have someone else monitor the emails or whatever and reach out to me when failures occur.

If this can't be done via the module I don't mind using scripts as long as I have some form of verification that the job is working correctly, but am honestly not very good at writing scripts and don't know where to start. Also if there are other options for syncing the data between the two FreeNAS instances I am open to using them, but require some sort of visibility into what is happening especially when failures occur.
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
Why are you using rsync instead of the built-in replication? See Replication Tasks.
 

Randy_ICS

Cadet
Joined
Sep 14, 2017
Messages
5
That was where I originally thought to start, but the reason I was looking to use rsync instead is how often it can run. rsync can run every minute where the snapshots can only run every 5 minutes.

There will be data in the storage location updated constantly throughout the day and was hoping to sync these changes constantly.

Also I was hoping to reduce footprint by not needing to keep snapshots in storage on the devices. I only need the most up to date version of the data.
 
Last edited:

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
Running rsync that often is going to have performance implications. Why does it need to run that often?
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
I have serious doubts that rsync can even finish going through a decent amount of data in a minute, much less finish the whole process.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
If you need up-to-the-minute data synchronization between two (or more) servers, is FreeNAS really the product for you? Sounds like you need some kind of HA solution, which FreeNAS just doesn't offer (though TrueNAS does, IIRC).
 

Randy_ICS

Cadet
Joined
Sep 14, 2017
Messages
5
The problem is we don't have the budget for new hardware right now. Eventually we will move to using an HA solution, but we need a replicated storage solution for the interim until we have the budget for hardware.

I'm going to test with the built-in replication and see if it can handle the amount of file changes we will have daily and if every 5 minutes will work for us. Hopefully this will work for now.

I am open to any other suggestions that you may have for a solution that will work for my situation.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Replicating every five minutes is doable, but you will probably want to aggressively retire the five-minute snapshots and have a separate snapshot task with a longer life and longer period, so as to not overwhelm your storage.
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
I have serious doubts that rsync can even finish going through a decent amount of data in a minute, much less finish the whole process.

Rsync takes 3+ hours to go through my dataset... One of the primary reasons I switched to ZFS replication for onsite backup. Still working on switching to zfs replication for offsite backup.
 
Last edited:

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
The problem is we don't have the budget for new hardware right now. Eventually we will move to using an HA solution, but we need a replicated storage solution for the interim until we have the budget for hardware.

I'm going to test with the built-in replication and see if it can handle the amount of file changes we will have daily and if every 5 minutes will work for us. Hopefully this will work for now.

I am open to any other suggestions that you may have for a solution that will work for my situation.

I use hourly replication from one FreeNAS to another, and that causes a potentially heavy replication stream (as all NAS writes from the previous hour get transferred suddenly). A very good idea to ensure there is a separate NIC for the replication stream, otherwise it will affect client read traffic. If the two boxes are physically close, a simple direct ethernet link between the two would take the replication traffic off the LAN.

Also, if either box doesn't have AES-NI, then using encryption on the replication can be a bottleneck.
 
Last edited:

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
Rsync takes 3+ hours to go through my dataset... One of the primary reasons I switched to ZFS replication for onsite backup.
Just for comparison purposes, how long does ZFS replication take? Surely that's going to be a variable value, but maybe a relative speed compared to rsync?
 

Randy_ICS

Cadet
Joined
Sep 14, 2017
Messages
5
I have the NAS replication on a separate 10GB network.

So far the tests of ZFS replication has been promising, but I haven't had the chance to really put full load and push it to the limit of our production environment.
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
Just for comparison purposes, how long does ZFS replication take? Surely that's going to be a variable value, but maybe a relative speed compared to rsync?

Instant. The time it takes to take a snapshot.

Rsync takes 3 hours to determine no changes.
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
I was thinking more of the time to transfer changes to another system. rsync is designed to minimize network traffic, not go as fast as possible. ZFS knows what changed, so it doesn't need to check each file for the snapshot. But I suspect that it has lower network impact even when a lot of things did change.
 

TidalWave

Explorer
Joined
Mar 6, 2019
Messages
51
I'm a bit confused on how replication works. I read the instructions under the documentatin and I'm confused by the term "snapshots".

We simply want to copy all data from one server to another.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I'm confused by the term "snapshots".
What about that term confuses you?
We simply want to copy all data from one server to another.
Replication operates on snapshots. Take a snapshot, send it to the remote server, repeat periodically (on whatever schedule you decide to set).
 

TidalWave

Explorer
Joined
Mar 6, 2019
Messages
51
So if i moved the replicated server with the snap shots to a new facility would the data be accessible or will i need the orginial server with the actual RAW data on it?
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Of course it's accessible, anything else would be a rather useless feature.
 
Top