How to initial sync mongo replica

513 Views Asked by At

My mongo slave is dead because it stopped unexpectedly due to not enough space and It wont start due to

mongodb.service: Main process exited, code=exited, status=14/n/a

I tried to fix the error with following suggestions:

https://askubuntu.com/questions/823288/mongodb-loads-but-breaks-returning-status-14

but it lead to next error code:

mongodb.service: Main process exited, code=exited, status=100/n/a

which I tried to fix with following

https://dba.stackexchange.com/questions/220411/sudo-service-mongod-start-returns-error-100

this it it log output

2021-05-01T18:25:30.987+0000 I -        [initandlisten] Fatal assertion 28579 UnsupportedFormat: Unable to find metadata for table:index-3-848131710157586571 Index: {name: _id_, ns: local.me} - version too new for this mongod. See http://dochub.mongodb.org/core/3.4-index-downgrade for detailed instructions on how to handle this error. at src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp 241

The command sudo service mongodb start wont work because the status command shows that the service is dead.

enter image description here

I figured out that it would be easier to resync the data from scratch. I found the documentation

https://docs.mongodb.com/manual/tutorial/resync-replica-set-member/#resync-a-member-of-a-replica-set

but I am not fully aware what commands run to execute this operation.

My dbPath = "/mnt/mongo/mongodb", MongoDB shell version v3.4.14, and my database has about 2.5T. Could you give my some guidance how to execute initial sync mongo replica?

From my understanding i should

  1. sudo rm -r /mnt/mongo/mongodb/*
  2. sudo service mongodb start
  3. After some time everything should get back to normal(?)

Correct me if I am wrong...

0

There are 0 best solutions below