ZFS Replication path question

Status
Not open for further replies.

dcj

Cadet
Joined
Oct 16, 2014
Messages
5
I have 2 FreeNAS boxes, both running 9.2.1.8

I set up a ZFS snapshot task, and a replication task on push system, for the dataset tank/foo/bar/baz
and wanted that dataset to be replicated on the same dataset on the pull system, so the target is also
tank/foo/bar/baz.

The result of the replication on pull was tank/foo/bar/baz/foo/bar/baz which is not what I intended.

Should I have specified the target as simply tank?

If so, assuming there are other zfs datasets on pull in tank, will they be left alone? E.g. if on pull there is a dataset tank/foo/zap that will not be affected by the recv of tank/foo/bar/baz ?
 

saurav

Contributor
Joined
Jul 29, 2012
Messages
139
I think if you want the same dataset tree on source and destination (aka PUSH and PULL), you have to specify the target simply as "tank".

I had this same dilemma (whether other datasets on PULL's tank are left alone) when I was setting up my replications, i. So I replicate to tank/replicas on PULL. I later realised its probably better that way. That gives me the freedom to create other datasets on PULL's tank without having to worry about whether some replication task in future is going to destroy them so long as I keep them out of tank/replicas. Also, if some day I have to do the "Initialize remote side for once" thing, at the most it will empty out the replicas dataset on PULL, and not wipe out everything in PULL's tank.
 

dcj

Cadet
Joined
Oct 16, 2014
Messages
5
Yes, what @saurav said. I was scared to do this, so set up a mock pool structure in another pool, and tested it. It did what I wanted, and didn't mess with other things.
 

Scharbag

Guru
Joined
Feb 1, 2012
Messages
620
Just noticed this behaviour once I got a replication task going.

How then could I keep tanka and tankb syncd using a replication task? Seems to me that if I use tanka as the source and tankb as the target, I will end up with tankb/tanka once the replication is complete.

I am not sure if this will be an issue or not...

Cheers,
 

saurav

Contributor
Joined
Jul 29, 2012
Messages
139
Did you actually try this? If your source is "tanka/<some-dataset>" and destination is just "tankb", you should end up with "tankb/<some-dataset>", unless I'm mistaken in a big way.

Or is that not what you want?

May be create a small dataset on tanka and replicate it that way to tankb and see what results?
 

Scharbag

Guru
Joined
Feb 1, 2012
Messages
620
Yes, if you have tanka/<dataset> and you replicated it to tankb, you end up with tankb/<dataset>. So all is good.

I guess my original thought was you could snapshot the pool but that is wrong. You have to snapshot the dataset. My bad.

I think I will stick with rsync for backups as it allows me a little more scheduling freedom. Still learning, might change my mind still :P

Cheers,
 
Status
Not open for further replies.
Top