Hello,
I’m looking for pointers and opinions on the simplest reliable way to back up a MongoDB replica set without using PBM and a shared NFS storage.
Current setup
- Percona Server for MongoDB 8.0.19-7, running in Docker containers (
percona/percona-server-mongodb:8.0.19-7) - 4-node replica set: Primary, 2 Secondaries, 1 Hidden member
- Two independent replica sets on the same hosts, both small: a logical backup is about 200 MB for the larger one and under 10 MB for the smaller one; a physical backup is about 2 GB
- Today: PBM 2.13.0 with filesystem storage on an NFS share, PITR enabled, daily logical and weekly physical backups
- The NFS server runs on the hidden node itself, so backups live on a member of the cluster they protect
- All VMs are covered by a daily VM-level backup (snapshot based). We do not control the exact time each VM is backed up, only the global job.
Why we are considering a change
PBM works, but the NFS part added complexity and caused real issues:
- containers starting before the NFS mount and silently writing to the local directory
- orphaned backup files
- boot ordering and mount options to get right on every node
Management would like to reduce the number of moving parts. An RPO of 24 hours may be acceptable (12 hours would be better…still to be confirmed), so PITR could be a nice-to-have rather than a requirement.
Options we are evaluating
mongodump --oplog --gzip --archivefrom the hidden member, scheduled with cron, written to a dedicated local disk on that node, with simple file-based retention. The daily VM backup then carries the dump files off the node.createBackup(Percona hot backup) on the hidden member, to a local directory or to an S3-compatible storage if one is available.- VM-level snapshot only, relying on the fact that data files and journal are on the same volume, so the snapshot should be crash-consistent and recoverable by WiredTiger.
- Keep PBM but switch storage to S3, if an S3-compatible object storage is available internally, to remove NFS and keep PITR.
Questions
- For a dataset this small, is
mongodump --oplogfrom a hidden secondary a sound choice for a daily backup? Any pitfalls to be aware of (consistency guarantees, users and roles, index rebuild time on restore,--oplogReplaybehavior)? - With
createBackup, what is the recommended procedure to restore a whole replica set from a single member’s backup (forced reconfig to a single-member replica set, then initial sync of the others)? Are there any Docker-specific considerations forbackupDir? - Is a crash-consistent VM snapshot of the hidden member considered a valid backup in practice? Any recommendation on using
fsyncLock()on the hidden member if the backup software can run pre/post scripts? - Without PBM, is there a reasonably simple way to get some point-in-time capability, for example periodically dumping
local.oplog.rsincrementally, or is that more trouble than it’s worth? - In your experience, which option gives the best balance between simplicity and restore reliability for a small replica set like this one?
Any links to official documentation, blog posts or real-world experiences would be very welcome.
Thank you!
Francesco