I have mongodb 8.0.10 replSet Primary on Windows Server 2019 with a total data volume of 40 TB, with a minimum collection size of 2 TB (80M+).
The task is to set up Secondary on the second Windows Server 2019.
Server resources: ProLiant DL360 Gen9, CPU 2xE5-2667v4@3.20GHz , 256Gb RAM, 4x1G LAN, Smart Array P441 Controller RAID 10 SAS 10x18Tb.
mongod.cfg - cacheSizeGB: 200
I tried using InitaiSync — 2 TB was transferred in 3 days — it’s very slow.
Recording in Primary has been stopped.
Is there a way to shorten the initialization of Secondary?
Any help to reduce the initialization time of Secondary!
Make a copy of all files in dbPath
to your secondary member. See Add Members to a Self-Managed Replica Set - Database Manual - MongoDB Docs
Thanks for the advice!
I thought this only applies to Enterprise.
So, I stop the primary and copy all files dbPath to the secondary?
Then I start the primary and secondary, and add rs.add({ host: “secondary:27017”, priority: 0, votes: 0 }) to the primary?
Isn’t it dangerous to start the secondary with data from the primary?
Why do you think so?
Hi! My MongoDB 4.4 nodes are in AWS instances. I cloned one replica via disk snapshot. Launched a new cloned replica and added it to the cluster.
But it launched some strange replication
{“t”:{“$date”:“2025-07-03T08:52:49.724+00:00”},“s”:“I”, “c”:“REPL”, “id”:51801, “ctx”:“ReplWriterWorker-110”,“msg”:“Applied op”,“attr”:{“CRUD”:{“op”:“d”,“ns”:“db1.hugecollection”,“ui”:{“$uuid”:“f345eb8b-1ad5-4f1b-a1b7-abaae9a1a052”},“o”:{“_id”:{“$oid”:“6724de34d37b14c437c82c71”}},“ts”:{“$timestamp”:{“t”:1751519309,“i”:3107}},“t”:60,“v”:2,“wall”:{“$date”:“2025-07-03T05:08:29.892Z”}},“durationMillis”:102}}
db1.hugecollection is very large and the replication lag on this replica is growing.
Maybe there are any ideas on how to overcome this? I would be very grateful!
In principle you follow Restore a Self-Managed Replica Set from MongoDB Backups where you skip the first part “Restore Database into a Single Node Replica Set”. So it should work.
The message you provided is just an information. What is the status of new member, i.e. output of rs.status()
?
I thought it was because of the dbpath/local where the settings are stored.
But I checked it, and it work fine!
Thank you!