ZFS replication (for dummies)

Soldato
Joined
14 Mar 2004
Posts
8,040
Location
Brit in the USA
Can somebody have a stab at explaining what ZFS replication is and how it works? I've Googled, but it's still all a bit complicated for me.

(there will probably be more such questions from me in the near future :p )
 
Hi,

ZFS replication is a very cool and useful feature. Have not used it in a production environment but only on my home ZFS storage server and it has got me out of problems a couple of times.

Basically as far as I am aware zfs send and zfs receive will send the named zfs snapshot across to another host running the zfs receive command and will then provide an exact copy of the original snap.

The good stuff then happens when you run a zfs send that only sends the diferences between the original snapshot and the new snap. Only the changed blocks (I think it is blocks) are sent so traffic is minimal dependant on your environment etc.

I use netcat to send the data streams between hosts as it seemed the quickest way although there are other ways such as ssh and mbuffer etc.

An example would be assuming you have a zfs dataset called pool/data and a snapshot called data@today on the sending server and that you have a zfs dataset called pool on the receiving server:

on target server first:
nc -w 120 -l -p 9090 | zfs receive pool/data

on sending server then:
zfs send pool/data@today | nc -w 20 192.168.0.2 9090

Works well for me.

Si
 
Back
Top Bottom