0

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...

Przemek
  • 647
  • 2
  • 8
  • 25
  • 1
    Yes, it's correct. Of course you should stop the Mongo before you delete the data folder – Wernfried Domscheit May 01 '21 at 20:16
  • @WernfriedDomscheit do you know how to execute this faster? My db has 2.5TB and this might take a lot of time... Can I simply copy data from my `mnt/mongo/mongodb/` of my primary db to `mnt/mongo/mongodb/` of my slave? – Przemek May 01 '21 at 21:32
  • 1
    Yes, see https://docs.mongodb.com/manual/tutorial/restore-replica-set-from-backup/#std-label-restore-rs-copy-db-files – Wernfried Domscheit May 02 '21 at 06:03

0 Answers0