Hi
i need to run mongorestore on the primary but i do not want to blow up the oplog.
You can get a summary of the oplog using the rs.printReplicationInfo()
, which will show you the detail of your oplog in terms of size and time (i.e. the difference in timestamp between the earliest and the latest oplog entries). Based on the oplog size, you can then approximate how much time is required for the latest oplog entry to be overwritten. Of course, this is an approximation, and the actual time would also depend on how busy your deployment is, which may change day-to-day.
Since the oplog was designed to perform this kind of operation, do you have a specific concern regarding filling the oplog due to mongorestore
?
Best regards,
Kevin
Hi David,
configured oplog size: 4348.386688232422MB
From the output you provided, it appears that your oplog is 4GB in size, not 70GB. Is this correct? In this case, you are restoring more data than what the oplog can hold, and if your secondaries cannot keep up, they could fall off the oplog. Having said that:
i restore the first file i will not completely fill the oplog and cause a secondary to get out of synch
By default, mongorestore
will perform the restore using write concern majority if you specify that you are restoring to a replica set using the correct host parameter.
You can of course specify a stronger write concern setting to specify that the restore must be replicated to all members of the replica set. This will ensure that none of your secondaries would be left behind. See write concern for more information on different write concern settings and how it affects replicated writes.
On another note, your MongoDB 3.0.7 is quite old as it was released in 2015. You might want to consider upgrading to the latest in the 3.2 series or even better, the 3.4 series. There have been many significant improvements and bug fixes since then.
Best regards,
Kevin