Circular Replication

C2Opps

Dabbler
Joined
Jun 11, 2018
Messages
25
Hi All,

Had a look in previous threads on this but either there isn't anything or i'm not using the correct search terms.

In any case I have two FreeNAS systems one at each site that for 1 particular small dataset of ISO's / system tools I would like to do some kind of circular replication.
Data changes on Box1 ISO Dataset would be replicated to Box2 ISO dataset, also if data is changed on Box2 ISO dataset it would be replicated to Box1 ISO dataset.
Both datasets would have the same file structure and so conceivably add ExampleFile1 at site 1, it ends up at site 2 in the same folder then if that file was modified at site 2 it would replicate and over write ExampleFile1 at site 1

This dataset rarely has new things added or removed and data is almost never edited, once we put an ISO into the dataset (on either box) we'd would like it available at the other site within a few hours or a day (not sure yet).

Is it reasonable and safe for the data to setup ZFS replication to do this in both directions (at separate times) and if so are there any issues i should be aware of such as
-Needing to make sure that the replication never overlaps - say a large influx of new data was making replication take a long time in one direction and the replication in the other direction started would it / could it cause an issue or would it be fine
- Needing to do anything clever with regard to the replication / set special options

Many thanks in advance,
C2Opps
 

blanchet

Guru
Joined
Apr 17, 2018
Messages
516
With ZFS replication, I think that it will never work, but with two rsync tasks, it is possible :

On only one freenas box, you setup two rsync tasks in Tasks | Rsync Tasks
  • at 08:00 AM you setup a push
  • at 08:00 PM you setup a pull
 

C2Opps

Dabbler
Joined
Jun 11, 2018
Messages
25
Hmmm - are you certain it wouldn't work with ZFS replication as I had thought if you had 3 FreeNAS systems you could ZFS Replicate A--> B, B---> C and if that would work why wouldn't it work in A--->B , B---> A
 

blanchet

Guru
Joined
Apr 17, 2018
Messages
516
My proposition with rsync requires neither development nor modification of FreeNAS. It is easy to understand and to setup.

Circular ZFS replication may work if you write your own replication tool on top of zfs send/receive. But with the FreeNAS ZFS replication tool I really think that it will never work.

FreeNAS ZFS replication requires periodic snapshots. After the synchronization, FreeNAS deletes the snapshots on the remote server that are not present on the source. Obviously you can disable automatic snapshot deletion or use zfs hold to lock some of them, but in this case you have to manage snapshot deletion by yourself.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Unison is a great tool for this sort of thing, but automating it could be tricky.
 
Top