Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Data too stale, halting replication

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.

like image 378
ipop911 Avatar asked Mar 20 '26 18:03

ipop911


1 Answers

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"

like image 74
Wesley Avatar answered Mar 23 '26 17:03

Wesley