I have an error in MongoDB replication: Data too stale, halting replication. I tried to delete all collections from my databases, but it doesn't work. How can I delete oplog to work my replication? I just need the replication to work.
Thanks.
You do NOT want to delete your oplog. You simply stop your mongod process on a secondary, delete the data database files within your secondary's data directory, and then start your mongod on the secondary. You then do this on all affected secondaries.
As user Zamnuts pointed out, you should read the MongoDB documented titled "Resync a Member of a Replica Set"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With