FreeNAS to FreeNAS Sync?

Status
Not open for further replies.

nogi

Explorer
Joined
Jul 5, 2011
Messages
74
Hi, I’m about to build a 2nd FreeNAS box which will be identical to my current one:
  • HP Microserver N36L
  • 8Gb ECC RAM
  • 4 x Hitachi 3 TB (7k3000) HDDs
  • NC360T Dual Gig NIC + on-board in LAGG
I would like for this to be a real-time replica of the first. What’s the best way to do this?
 

Durkatlon

Patron
Joined
Aug 19, 2011
Messages
414
For real-time replica I would definitely go with ZFS snapshots+replication. For slightly less frequent replication (once a day for instance), rsync might be the better choice, only because it seems to be easier to use and get going. I'm sure once you have a smooth running ZFS replication setup, it's just as good and stable, I just had a hard time with it when i was futzing around with the myriad settings and ssh keys.
 

nogi

Explorer
Joined
Jul 5, 2011
Messages
74
Thanks guys. I'm wondering if setting up a daily rsync is going to be easier for me to get going from day 1. I've just printed the FreeNAS manual for some lunch time reading.
 

nogi

Explorer
Joined
Jul 5, 2011
Messages
74
Ok, I setup rsync as per http://doc.freenas.org/index.php/Rsync_Tasks for syncing between 2 FreeNAS servers. It’s working but not like the way I would like….

Source mount: /mnt/DATA
Destination mount: /mnt/KDATA

I was expecting the contents of DATA to be replicated into KDATA but instead, it’s replicating to KDATA/DATA. How can I prevent it from creating a sub-directory?

I want
Code:
/mnt/DATA/Folder 1
/mnt/DATA/Folder 2
/mnt/DATA/Folder 3

To replicated as
Code:
/mnt/KDATA/Folder 1
/mnt/KDATA/Folder 2
/mnt/KDATA/Folder 3

Not as
Code:
/mnt/KDATA/DATA/Folder 1
/mnt/KDATA/DATA/Folder 2
/mnt/KDATA/DATA/Folder 3
 

Milhouse

Guru
Joined
Jun 1, 2011
Messages
564
Try adding /. to the source directory...

Also best to work out the required rsync arguments at the CLI (using --dry-run option), adding -i to show what files would be transferred and where.

Something like "rsync -tiprogl --delete --dry-run /mnt/DATA/. /mnt/KDATA" might work.

Edit: As Durkatlon suggests, just a slash should fix your problem.
 

nogi

Explorer
Joined
Jul 5, 2011
Messages
74
Ok, adding the /. at the end of the path doesn't appear to do anything. When it saves, it removes it?
 

Milhouse

Guru
Joined
Jun 1, 2011
Messages
564
Hmmm yes, the GUI will remove trailing slashes... I might consider that a bug/enhancement.
 

Durkatlon

Patron
Joined
Aug 19, 2011
Messages
414
Hah hah, weak. :D I guess this is why I used a manual script instead of the GUI to set up rsync. Yeah, you should file a bug report on this one. Hard to believe other people haven't complained about this yet.
 
Status
Not open for further replies.
Top