MongoDB initial sync on a large database MongoDB initial sync on a large database mongodb mongodb

MongoDB initial sync on a large database


Best solution is use file system snapshot, if possible.

You can snapshot mongod node directly, as long as oplog files are at same diskspace than rest of data files. No need to "shutdown" or do anything else proactive things.

how to make restore with snapshot

Then you just copy those files to new nodes data directory and start mongod.

If file system snapshot is not possible, then some other way to take copy of working mongod data directory, what is easy if you can have downtime. If you cannot have downtime, you can always add few (two) arbiters and stop that other secondary for a moment (to take copy of data dir), of course during that time your replica set is basically "one node RS".