3

I have installed MongoDB in Ubuntu 14.04 but I am unable to change its storage engine to WiredTiger.

I have added the necessary changes to the /etc/mongod.conf file which is namely as the following-:

storage:
  dbPath: /var/lib/mongodb
  journal:
    enabled: true
  engine: wiredTiger

I have started the mongod process using the following command-:

mongod - f /etc/mongod.conf

The server starts up but I still get the warning when I connect to my shell-:

2017-01-10T15:36:54.866+0530 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine

Am I missing something over here ? The changes seem to have no effect.

  • Could you share what is the output of db.serverStatus().storageEngine in the mongo shell? – moalf Jan 10 '17 at 12:11
  • @moalf Its using wiredTiger. – ng.newbie Jan 11 '17 at 4:15
3

Based on the warning message included in your description, you are already using the WiredTiger storage engine but your dbPath is using the ext file system (in theory ext4, but the Linux filesystem magic number doesn't distinguish ext2/ext3/ext4). Note: WiredTiger is the default storage engine for MongoDB 3.2+, so there is no need to specify it in your configuration file.

This warning was added for the MongoDB 3.4 production release per SERVER-22606: Startup warning if ext4 is used with WiredTiger. There are some known performance issues with ext4 (in particular, periodic stalls) so this warning is meant to proactively ensure administrators are alerted to potentially problematic configurations. Filesystem and other production caveats are also included in the Production Notes in the MongoDB manual.

To suppress this warning you could either:

  • Host your dbPath on a supported filesystem other than ext4 (XFS is recommended)
  • Start your mongo shell with the --quiet parameter (which might suppress other interesting startup info / warnings)

You can certainly choose to ignore startup warningd (particularly for a development environment), but should consider using XFS with WiredTiger if this is a production environment.

You may want to watch/upvote SERVER-19790: Provide mechanism to clear/acknowledge startup warnings, which could allow startup warnings to be ack'd so they do not appear on every new mongo session.

  • What I don't seem to understand is that I am not using the XFS filesystem, so then why does mongo tell me that I am ? Also couldn't the warining be a little more clear, like using WiredTiger with ext might cause problems ? – ng.newbie Jan 11 '17 at 4:14
  • 1
    @ng.newbie The startup warning is that "Using the XFS filesystem is strongly recommended", not that you are currently using XFS. The following line in the startup warning (which isn't included in your excerpt) includes a link to the documentation for more info: "See dochub.mongodb.org/core/prodnotes-filesystem". – Stennie Jan 11 '17 at 4:19
0

To change Storage Engine in Mongo DB on Ubuntu Linux from WiredTiger to MMAPv1 (or vice versa)

Assuming you don't have data that needs backing up, as you've run into this issue you probably have an EXT4 file system that WiredTiger struggles with, rather than XFS. If you do, then export/back up the data first then re-import.

To check your current filesystem use:

 `sudo parted -l`
  1. rename the folder /data/db, which contains the old WireTiger storage data. I suggest you rename the old folder to /dataWiredT so you have it if you ever need to revert.

    sudo mv /data /dataWiredT
    
  2. create a new /data/db with

    mkdir /data
    mkdir /data/db
    
  3. you can try to alter Storage Engine now by:

    mongod --storageEngine=mmapv1 --dbpath /data/db
    

More info here on how to Change Storage Engine (for MVAPP use reverse as you've just done)

You may hit a permission issue 'lock' on your new /data/db read only folder then use:

sudo chmod -R go+w /data/db    to alter permissions  

(note that will allow anyone to write - if production DB consider security - some more info here: https://stackoverflow.com/questions/42446931/mongodb-exception-in-initandlisten-20-attempted-to-create-a-lock-file-on-a-rea

Note, there may be usual Warnings about Access Control & Read/ Write access not restricted to fix once started MongoDB

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.