I recently upgraded an Ubuntu 14 server to 16, and now I'm unable to start the MongoDB service.
I'm using MongoDB 3.4, from Mongo's Xenial PPA at http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4.
If I run:
sudo rm -Rf /var/log/mongodb/*
sudo service mongodb start
and then wait a few minutes, and in /var/log/mongodb/mongodb.log
I see:
2018-02-06T17:42:07.322+0000 [initandlisten] exception in initAndListen: 28574 Cannot start server. Detected data files in /var/lib/mongodb created by storage engine 'wiredTiger'. The configured storage engine is 'mmapv1'., terminating
I'm assuming the default storage engine changed between releases, from "wiredTiger" to "mmapv1"? How do I set the storage engine back to "wiredTiger"?
If I add:
storage:
dbPath: /var/lib/mongodb
journal:
enabled: true
engine: wiredTiger
to my /etc/mongod.conf
, I get the same error. If I try adding that to my /etc/mongodb.conf
, I get the error:
Error parsing INI config file: the options configuration file contains an invalid line 'storage:'