Sync mongodb to remote, problem with mongooplog

51 views
Skip to first unread message

rr Feng

unread,
Oct 13, 2016, 10:56:52 PM10/13/16
to mongodb-user
My environment:
- local repl cluster with node A B C, A is the primary.
- local replset name: RSL
- remote: a mechine M, not running mongod
- remote: a config file has been prepared.


My step:
- stop local node C
- rsync data dir to M
- start mongod withou --replSet
- save last oplog entry to local.temp( with time T)
- update the local.system.replset as new cluster
- insert the last oplog entry from local.temp
- restart mongod with --replSet
now the new mongod is running ok
- start local node C
- calc the oplog timestamp shift  (NOW - T)
- run mongooplog --from C --to M -s $((NOW - T + 10))

Please tell me, is this steps OK?

and a problem: 
mongooplog start to fetch oplog and applyOps to M, but it runs slow, the oplog lag is growthing....
how could I fix this? 

rr Feng

unread,
Oct 14, 2016, 3:27:41 AM10/14/16
to mongodb-user
One more problem:

mongooplog say "2016-10-14T14:55:35.805+0800 done applying oplog entries" and stopped.
but at that time, there  were millions of oplog to fetch and apply, why?

Kevin Adistambha

unread,
Oct 31, 2016, 11:49:07 PM10/31/16
to mongodb-user

Hi,

My environment:

    • local repl cluster with node A B C, A is the primary.
    • local replset name: RSL
    • remote: a mechine M, not running mongod
    • remote: a config file has been prepared.

      My step:

      • stop local node C
      • rsync data dir to M
      • start mongod withou —replSet
      • save last oplog entry to local.temp( with time T)
      • update the local.system.replset as new cluster
      • insert the last oplog entry from local.temp
      • restart mongod with —replSet

      • now the new mongod is running ok
      • start local node C
      • calc the oplog timestamp shift (NOW - T)
      • run mongooplog —from C —to M -s $((NOW - T + 10))

      Please tell me, is this steps OK?

      and a problem:
      mongooplog start to fetch oplog and applyOps to M, but it runs slow, the oplog lag is growthing….


      how could I fix this?

      Could you elaborate on what you are trying to achieve? Are you trying to make a backup of one replica set and restore it on a new replica set, or are you trying to attach a new remote node to an existing replica set?

      If you are trying to restore an existing replica set data on a new replica set, you should follow the steps outlined in the Restore a Replica Set from MongoDB Backups page instead of manually modifying the contents of the local database, especially the oplog collection.

      If you are trying to add a new remote node to an existing replica set, you could follow the procedure outlined in the Add Members to a Replica Set page

      Best regards,
      Kevin

      Reply all
      Reply to author
      Forward
      0 new messages