TrueNAS Scale syncronization

Hello! I have a question about the best tools for taking two TrueNAS boxes and making them hold the same data.

I have two machines, each running Proxmox with a TrueNAS Scale VM. One is going to be my local machine and the other I’m setting up at my parent’s house as an offsite copy but also to run a Jellyfin/etc server for them.

I have 5G internet with CGNAT and I don’t want the mess with their router.

I want both machines to hold the same data and new/changed data might be added to either machine so this would be a two-way syncronization, though I do not need this to be real time. They could sync on a schedule, etc.

I’ve used SyncThing before and it seems to work well and will avoid any routing issues with CGNAT etc. But I wanted to check if there was a better way to do this? I’ve watched Tom’s recent videos on Replication but I’m not sure if this will work in two directions (I understand it wouldn’t be real time syncronization).

I’m planning to also set up Tailscale to manage things, so I’ll have that available also.

Thanks!

I just rsync the two NAS with --delete

ex. rsync -a --delete /mountpoint/nas1/ /mountpoint/nas2

nas1 and nas2 have exactly the same data. diff na1 nas2 says all common

ZFS Replication is just like it’s name implies, replication, not synchronization. I keep my personal data synced in real time with Syncthing. It will work fine over a VPN such as Tailscale.

So it wouldn’t be an inappropriate use of Syncthing to sync the entire pool? I don’t know why, that just feels too easy. :laughing:

If you have the bandwidth and CPU power, sync as much as you want!

1 Like

Syncthing would be a great way to do this, but it’s worth noting that it will not sync any of the ZFS features. So nested datasets, for example, would become simple folders on the remote side. That could be no big deal, but it’s worth knowing if you ever want to take advantage of ZFS-specific tooling.

If it were me, I’d create a few high-level datasets on each system and treat each one as a separate sync folder in Syncthing.

I’m actually thinking that may work to my favor as it seems like you can’t have different permissions on datasets that are replicated from one machine to another, which could be annoying trying to share the data with different services on each machine. That said, permissions in TrueNAS make zero sense to me so I’m probably missing something.

Tom’s got some pretty good videos on TrueNAS permissions, so definitely check those out. If you’re just using the system for NFS or sftp, you can get away with simple Unix permissions, but SMB really does work nicely with more Windows-style permissions, which are really flexible, but kinda strange.

The biggest thing with SMB credentials on TrueNAS is the overwhelming mess of permissions that are populated by default and the seemingly redundant way everything seems to be added as both a user and a group, and user obj and group obj. Though this seems to be greatly cleaned up on Dragonfish.

But I still run into weird quirks like most recently with Syncthing, Syncthing by default has a user ID that matches the user “apps” but just adding the user “apps” to the permissions does not work. I have to make “apps” the owner of the dataset for it to work. However it seems that afterwards the ownership can be set back to something more logical and it still works.