I’m replicating a dataset from nas1 to nas2, and want to nfs export it from nas2. That works fine, until the next snapshot is replicated over, at which point the nfs client gets input/output errors when trying to access the export. I suspect that the new replicated snapshot blocks access to the directory that was previously exported and mounted.
This is TrueNAS-13.0-U4 (freebsd-ish not linux-ish). I suspect I could run “service mountd reload” but that’s “lower level” than I might prefer. I can use the midclt command to update the comment field for the nfs export with “midclt call sharing.nfs.update 14 ‘{“comment”:“replica access”}’” which I assume triggers a re-export and works until the next replica. I can jump through a few hoops and cause this to happen in sequence in my somewhat limited case, but it feels kind of like a hack.
I don’t see a way for truenas to run a command post-replicate - but even if it could, or if it re-exported automatically, there would still be a short window when (I assume) the export would be inaccessible (those input/output errors).
I suspect a more “proper” approach would be to rsync the replicated directory to a local dataset and export that, but that would waste a couple of terabytes of space.
Any suggestions on a nice clean way to do this? I feel like this isn’t that strange a use case e.g. having a bunch of data that wants to be shared across multiple locations. Thanks!