Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-12174

Clarify how much down time is needed for iterative rsync approach to initial sync

    • Type: Icon: Task Task
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • 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/

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

            Assignee:
            Unassigned Unassigned
            Reporter:
            arnie.listhaus@mongodb.com Arnie Listhaus
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:
              1 year, 5 weeks, 4 days ago