MongoDB automatically updated to 3.6 after doing a system update and was no longer compatible with my old dataset. So I downgraded to 3.4 again, however now the mongo instance won't start at all and exits with error code 100. Any help would be appreciated.
Asked
Active
Viewed 132 times
0
-
1Hi @robertbabington, have you tried removing mongod.lock from temp. Please try once. Also, the error clearly says the files are corrupted try mongodb --repair comand – Priyanka Kariya May 31 '19 at 12:42
-
1Thanks, I got it in the end. Answer posted below. – robertbabington Jun 06 '19 at 08:36
1 Answers
0
There were a series of issues piggybacking on one another here, but I sorted this out.
Firstly I reverted from 3.6 to 3.4 by uninstalling Mongo:
sudo service mongod stop
sudo apt-get purge mongodb-org*
Then I installed the specific version of Mongo:
apt-get install mongodb-org=3.4.1 mongodb-org-server=3.4.1 mongodb-org-shell=3.4.1 mongodb-org-mongos=3.4.1 mongodb-org-tools=3.4.10
Then I deleted the .lock
files:
rm -rf /path/to/mongod.lock
rm -rf /path/to/WiredTiger.lock
Next you have to grant permissions to Mongo again:
sudo systemctl enable mongod
(Make sure the dbpath
is correct in /etc/mongod.conf
. If you want to make any changes to the mongod.service
file, do it now, and remember to run systemctl daemon-reload
to set the changes.)
Then finish updating permissions:
sudo chown -R mongodb:mongodb /var/lib/mongodb
sudo chown -R mongodb:mongodb /var/log/mongodb
Now service mongod start
or sudo systemctl mongod start
should work.
Here are links to some of the resources I found helpful:
![](../../users/profiles/3025130.webp)
robertbabington
- 189
- 1
- 2
- 10