If unexpected shutdown while replication in startup status


Recently, the data on the secondary was all gone due to some server problem, and I started replication data from Primary.

the server I’m using will be closed at 10pm, In this situation, when the server restarts every morning, data replication seems to start all over again.

is there any way If I restart the Mongo database, is there a way to restart it from where I replicated the day before?

Thank you.

how do you know this?

If the oplog size is not big enough to hold the “missed writes” during that shutdown time, then an initial sync will have to kick off.

Try this if your mongo version is high enough. As long as the oplog data is still in primary, the replication should continue from where it is left before shutdown

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.