-
Type: Task
-
Resolution: Won't Do
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Server
-
Labels:None
Description
Our docs currently state:
Back Up with cp or rsync If your storage system does not support snapshots, you can copy the files directly using cp, rsync, or a similar tool. Since copying multiple files is not an atomic operation, you must stop all writes to the mongod before copying the files. Otherwise, you will copy the files in an invalid state.
However, the procedure for rsync does not need to include downtime for the duration of the initial sync if we use an iterative rsync process e.g.:
1. Shut down target node
2. run rsync against a secondary in the replica set while it is live
3. repeat step 2 multiple times until the time to complete the rsync process is much smaller than your oplog window
4. run db.fsyncLock on the sync source being used
5. run rsync one last time - this will be fast
6. run db.fsyncUnlock on sync source
7. startup target node - it will sync with any new updates that occurred after the db.fsyncLock. This will be very quick.
A sample rsync command should be included in the docs e.g.:
rsync -avKkz --progress --del root@hostname-of-sync-source:/opt/mongo/ /opt/mongo/