Advice on two-way replication and data-set structure

Status
Not open for further replies.

freenastier

Dabbler
Joined
Feb 9, 2017
Messages
20
I have two Freenas machines. My primary machine is connected to my LAN network and I have a secondary machine at a friends place which I use as a backup destination for a replication task running on my primary machine. I believe I have this finally working as intended. So far so good ...

The primary machine only sends backups to the secondary machine. Now I would like to synchronize both ways between the primary and secondary machine.
To clarify: I would like my data to be backed up on the secondary machine, but some data sets on the secondary machine should be backed up to my primary machine. This way my friend and our band (I play in a band and the secondary machine also contains recordings and other data for our band) can also benefit from some redundancy their data.

I think I made a design flaw when I originally made my primary machine, because I created a root data-set containing all other sub-data-sets. This seemed convenient when I only had one system, but later on I realized this was a bad idea. Therefore when I build the secondary machine for remote backups I decided I had to replicate the sub-data-sets to data sets of their own.

The Primary machine has the following structure:
  • MyPool (this is the volume name)
    [**] MyRootDataSet (this is the root-data-set containing al other data-sets)
    [***] Alice
    [***] Bob
    [***] Band
    [***] Work

On the Secondary machine I opted for this structure:
  • MyVolume (this is the volume name)
    [**] Alice
    [**] Bob
    [**] Band
    [**] Work
    [**] Media
    [**] Charlie

As you can see I got rid of the root-data-set and I added two data-sets used on the remote location. Now I have to make replication tasks of every sub-data-set on my primary machine and replicate them to a root data set on the secondary machine.
For example MyPool/MyRootDataSet/Alice is replicated to: MyVolume/Alice.

The problem is that I have a data-set called 'Band' which was replicated from my primary machine to the remote machine. Now I would like to reverse this flow. The 'Band' data-set on the secondary system should be backupped to my primary system but that is not possible without destroying the 'MyRootDataSet' data-set is it?

Is there a elegant solution for this or do I need to delete the MyRootDataSet/Band data-set and create a new Band data-set on my primary system?

How would an ideal data-set structure look like for replication both ways between two Freenas systems?
Advice and suggestions are much appreciated!
 

diedrichg

Wizard
Joined
Dec 4, 2012
Messages
1,319
FYI, there is a command to move a dataset to a different location. I did this when I decided to nest most of my datasets one level deeper. It was not complicated and worked well. I don't remember the command but searching for FreeBSD move dataset should get you some results.
 

freenastier

Dabbler
Joined
Feb 9, 2017
Messages
20
That sounds like the elegant solution I was looking for!

I think the command would look like this:
Code:
zfs rename -p MyPool/MyRootDataSet/DataSet-name MyPool/DataSet-name

Where DataSet-name = {Allice,Bob,Band,Work}
 

diedrichg

Wizard
Joined
Dec 4, 2012
Messages
1,319
That sounds about right. You could do a test on a new "test" dataset. You should add in a -v to get verbose output so you know when it has finished.
 
Last edited:
Status
Not open for further replies.
Top