Trouble with mongo.conf

I have the following mongo.conf file:

# mongod.conf

# for documentation of all options, see:

# where to write logging data.
   destination: file
   logAppend: true
   logRotate: rename
   path: /var/log/mongodb/mongod.log

# Where and how to store data.
   dbPath: /data/mongo
      enabled: true
#   wiredTiger:
#      engineConfig:
#         directoryForIndexes: true

#  engine:
#  mmapv1:

# how the process runs
   fork: true  # fork and run in background
   pidFilePath: /var/run/mongodb/  # location of pidfile
   timeZoneInfo: /usr/share/zoneinfo

# network interfaces
   port: 27017
   bindIp:  # Listen to local interface only, comment to listen on all interfaces.
      mode: requireSSL
      PEMKeyFile: /etc/ssl/myPEMKeyFile.pem
      CAFile: /etc/ssl/myCAFile.pem

   authorization: enabled
   clusterAuthMode: x509
#    keyFile: /etc/ssl/keyfile


   replSetName: acsutrs02


## Enterprise-Only Options



The issue I have is with these three lines:

#   wiredTiger:
#      engineConfig:
#         directoryForIndexes: true

When they are commented out, the mongod service starts with no issue. When uncommented, I get the following error message:

mongod.service - MongoDB Database Server
Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sat 2020-04-18 05:19:49 UTC; 5s ago
Process: 10120 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=100)
Process: 10118 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS)
Process: 10115 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS)
Process: 10112 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS)
Main PID: 9048 (code=exited, status=0/SUCCESS)
Apr 18 05:19:49 ageutcl02mg01 systemd[1]: Starting MongoDB Database Server…
Apr 18 05:19:49 ageutcl02mg01 mongod[10120]: about to fork child process, waiting until server is ready for connections.
Apr 18 05:19:49 ageutcl02mg01 mongod[10120]: forked process: 10124
Apr 18 05:19:49 ageutcl02mg01 mongod[10120]: ERROR: child process failed, exited with error number 100
Apr 18 05:19:49 ageutcl02mg01 systemd[1]: mongod.service: control process exited, code=exited status=100
Apr 18 05:19:49 ageutcl02mg01 systemd[1]: Failed to start MongoDB Database Server.
Apr 18 05:19:49 ageutcl02mg01 systemd[1]: Unit mongod.service entered failed state.
Apr 18 05:19:49 ageutcl02mg01 systemd[1]: mongod.service failed.

Any suggestions as to what I have wrong in my mongo.conf file? I’ve tested it in a YAML validator and it came back ok, so I’m not sure what I have wrong. I’ve also compared this to a Mongo instance in our Production environment, and those parameters are set and the instance is running. This is v3.6.14 running on Centos Linux 7.

1 Like

Do you have another instance running on the same port,dbpath?
Please stop it and try to run mongod again

One thing that comes to mind is that may be this directory holds data files created by the in memory storage engine which is not compatible with wired tiger. So when you explicitly specify wired tiger in your config file, the server simply refuse to start. An ls of /data/mongo could provide clues if this is the case.


1 Like

You have to restart with a new or empty data directory.

This error should have appeared. It might be in mongo logs or journalctl -u mongod

2020-04-19T19:06:55.715+0000 I STORAGE  [initandlisten] exception in initAndListen: InvalidOptions: Requested option conflicts with current storage engine option for directoryForIndexes; you requested true but the current server storage is already set to false and cannot be changed, terminating