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
- drop local.oplog.rs
- 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