Reputation: 655
I was trying to downgrade my local mongodb version from 3.4 to 2.6.11 in ubuntu 14.04, I'm getting the following error when I'm trying to start mongodb:
2017-01-27T10:24:16.190+0600 [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
Here is the procedure I've followed
remove existing mongodb version
sudo apt-get --purge remove mongodb-org mongodb-org-*
sudo apt-get --purge autoremove
install 2.6.11 version
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install -y mongodb-org
sudo apt-get install -y --force-yes mongodb-org=2.6.11 mongodb-org-server=2.6.11 mongodb-org-shell=2.6.11 mongodb-org-mongos=2.6.11 mongodb-org-tools=2.6.11
pin version
echo "mongodb-org hold" | sudo dpkg --set-selections
echo "mongodb-org-server hold" | sudo dpkg --set-selections
echo "mongodb-org-shell hold" | sudo dpkg --set-selections
echo "mongodb-org-mongos hold" | sudo dpkg --set-selections
echo "mongodb-org-tools hold" | sudo dpkg --set-selections
start mongodb
sudo service mongod start
debugging
cat /var/log/mongodb/mongod.log
2017-01-27T10:24:16.190+0600 [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
screenshot
Upvotes: 1
Views: 940
Reputation: 4413
The default storage engine in 3.4 is wiredTiger
whereas it's mmapv1
in 2.6. Hence data from of 3.4 is not compatible with 2.6.
If your data is not important, just delete the content of data directory and you'll be fine:
rm -rf /var/lib/mongodb/*
If you need the data, reinstall 3.4, backup the data using mongodump
, downgrade to 2.6 and restore the data using mongorestore
.
Since 3.4 supports additional data types, you may run into some compatibility issues.
Upvotes: 2