Watch keynotes and sessions from MongoDB.live, our virtual developer conference.

Trouble with mongo.conf

I have the following mongo.conf file:

# mongod.conf

# for documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/

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

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

#  engine:
#  mmapv1:

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

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

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

#operationProfiling:

replication:
   replSetName: acsutrs02

#sharding:

## Enterprise-Only Options

#auditLog:

#snmp:

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
Docs: https://docs.mongodb.org/manual
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.

See https://docs.mongodb.com/manual/core/storage-engines/

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
2 Likes