I used MongoDB 3.6 and was following MongoDB documentation:
https://docs.mongodb.com/manual/tutorial/resync-replica-set-member
to do a full copy of data from Primary node to another mongod instance. I copied both admin and local plus all database folders into the new node. After all data are ready, added new node into replica set. It seems the replica set starts another initial sync and copy data from Primary to the new node. I got 400 GB data in primary node, so after a few hours Secondary node data size reach 600 GB and no disk space left and cause the sync fail. So it seems MongoDB still copying all data from Primary to Secondary even after I did this data copy manually. More surprisingly, it keeps the data I copied and continue to do its own data sync. Any suggestion?
dbPath
from your source replica set member and writes needs to be quiesced (mongod
shutdown or writes stopped usingdb.syncLock()
). If you are seeing new data files created in thedbPath
on the target server, I suspect you have an incomplete copy of the sourcedbPath
.