3

I've problem with enabling WiredTiger engine by setings in mongod.conf I'm using Centos 7, and this is my config

#/etc/mongod.conf
storage:
    wiredTiger:
        engineConfig:
            cacheSizeGB: 2
        collectionConfig:
            blockCompressor: snappy
    dbPath: "/var/lib/mongo"
systemLog:
    destination: file
    path: "/var/log/mongodb/mongod.log"
    logAppend: true
    #timeStampFormat: iso8601-utc
processManagement:
    fork: true
    pidFilePath: "/var/run/mongodb/mongod.pid"
net:
    bindIp: 10.0.1.136,127.0.0.1
    port: 27017
    wireObjectCheck : true
    unixDomainSocket: 
        enabled : true
security:
    keyFile: "/etc/mongo.rs1.key"
    authorization: "enabled"
replication:
   oplogSizeMB: 2048
   replSetName: rs1

Mongo starts but the enginge is mmapv1 :( This is the output in mongo log

Detected configuration for non-active storage engine wiredTiger when current storage engine is mmapv1

I can enable wiredtiger only by manualy invoking command

mongod --storageEngine wiredTiger

Is it something wrong with my config file? I have the same problem on Centos 6.

EDIT: On Centos 7 I can enable WiredTiger by making systemd init script (Mongo3 comes by default with /etc/init.d script).

/lib/systemd/system/mongod.service

[Unit]
Description=High-performance, schema-free document-oriented database
After=syslog.target network.target

[Service]
Type=forking
User=mongod
Group=mongod
PIDFile=/var/run/mongodb/mongod.pid
EnvironmentFile=/etc/sysconfig/mongod
ExecStart=/bin/mongod $OPTIONS run

# Other directives omitted
# (file size)
LimitFSIZE=infinity
# (cpu time)
LimitCPU=infinity
# (virtual memory size)
LimitAS=infinity
# (open files)
LimitNOFILE=64000
# (processes/threads)
LimitNPROC=64000

[Install]
WantedBy=multi-user.target

And changing start options in file /etc/sysconfig/mongod

OPTIONS="--storageEngine wiredTiger -f /etc/mongod.conf"

So ok this way it works fine, but still why doesn't it work when it is configured in mongod.conf file?

B14D3
  • 5,110
  • 13
  • 58
  • 82

1 Answers1

3

If I remember correctly, you have to have this in your config:

storage:
    engine: wiredTiger

Though I can't test it right now...

Edit: Found the same suggestion in How to migrate MongoDB 2.6 to 3.0 with WiredTiger

Fox
  • 3,887
  • 16
  • 23
  • I've wrote this config with help https://docs.mongodb.org/manual/reference/configuration-options/ and there is no such option like storage: engine: wiredTiger only storage: wiredTiger... – B14D3 Oct 30 '15 at 08:53
  • 1
    There is clearly [storage.engine](https://docs.mongodb.org/manual/reference/configuration-options/#storage.engine) as well, which does what you want. – Fox Oct 30 '15 at 08:55
  • I have it in my config, but it does not enable wiredTiger – B14D3 Oct 30 '15 at 09:00