I cannot use
wiredTiger as a service for
I followed this step by step guide;
Step-1: Start 3.0 mongod.OK, I did.
Step-2: Export the data using mongodump. OK
Step-3: Create data directory for WiredTiger. OK – user permissions were adjusted.
Step-4: Restart the mongod with WiredTiger. OK
mongod --storageEngine wiredTiger --dbpath <newWiredTigerDBPath>
mongod worked. But the
Step-5 says that “Upload the exported data using mongorestore.” However my console remains busy and says “waiting for connections on port 27017” because the last command does not include a service like
service mongod start.
Then I tried editing my
/etc/mongod.conf file to run as a service. But I couldn’t. I added wiredTiger directory as dbpath but I guess I need to edit
/etc/init/mongod.conf file because it contains some codes that change the permissions of the db directory.
After spending 8 hours, I don’t think there’s sufficient documentation to help,
so I’d like to ask;
What should I do in order to be able to use wiredTiger with MongoDB?
I’m wondering if there’s anybody who has managed to achieve this?
Edit on 2015-04-01:
I tried change-storage-engine-to-wiredtiger section that is on the documentation.
I wasn’t able to use wiredTiger upgrading MongoDB. However, at
May 17 I uninstalled MongoDB 2.6 then installed MongoDB 3.0.3 . Immediate after the installation, I added
storageEngine=wiredTiger on top of my mongod.conf file. Then I gave
sudo service mongod start command and eventually I could.
For fresh installed as directed by official documentation;
- Open configuration file using
sudo nano /etc/mongod.conf
- Change the
# engineline to
engine: wiredTigerlike the below
- Run mongod using the command
sudo service mongod start
# Where and how to store data. storage: dbPath: /var/lib/mongodb journal: enabled: true engine: wiredTiger # mmapv1: # wiredTiger:
If the current version is supported the wiredTiger;
- Get the backup of the current database using mongodump command
- Stop the mongod service using
sudo service mongod stopcommand
storageEngine=wiredTigertext as the first line of
- Delete the all file on
/data/dbfolder if used)
[This is important. Because MongoDB cannot convert the current MMAP db files to wiredTiger format]
- Start the mongod service using
sudo service mongod startcommand
- Restore the database from the backup using [mongorestore] command
- wiredTiger is being used…
Steps for migrating 2.6 to 3.0 on Ubuntu and using the new WiredTiger storage engine:
Backup current database:
mongodump --out final_2.6_backup
Stop mongodb service:
service mongodb stop
Remove current database files:
rm -rf /var/lib/mongodb/*
Edit /etc/mongod.conf to use the new storage engine:
service mongodb start
I use wiredTiger in a sharded cluster. I find it easier to roll a hidden node into each replica set and then swap the 4th node with a secondary.
1. stop the MongoDB service on the now 4th node
2. restart the instance, as a service, pointed to the new dbpath for and the storageengine option set to wiredTiger.
3. wait for the node to synch.
4. drop the old dbpath
I repeat that step until all nodes are up to date.
- If you are not using a replica set, it does appear you are limited to using mongodump and mongorestore. We have way too much data to rely on those tools. They take too long to execute.