0

Our MongoDB was created with replicaset, and the nodes went down due to some reason. Now after starting up its not starting up/ not able to find out the primary and secondary. From the logs we observed this error. "[rsSync] no valid sync sources found in current replset to do an initial sync" There is no way to promote one other nodes as primary, as the command needs to be run from primary database. Can anyone please suggest a way to bring the nodes up.

Also, onething we noticed is the show databases command and size of DBPath is showing differences in size. Is there any backend mechanism running to keep the data compresses in the DB (something like gzipping the data in filesystem), or expand the data in the filesystem? Please advise on this.

1 Answers1

0

Select one node and start it to maintenance mode by removing replSet parameter. Log to that node with mongo and select local database with use local. Update db.system.replset collectios members to have ONLY that nodes address. Restart your node with replSet parameter and you have now one node replica set with PRIMARY running. Now you can add those other nodes one by one and nodes will do initial sync

Those other nodes what makes initial sync, will automatically copy (and compress, if you use wiredTiger) only current data. After you have two healthy secondaries, you can start initial sync on that one node and it will compress it's data same way that those others did. (you can start initial sync by destroying data on dbPath)

JJussi
  • 1,540
  • 12
  • 12