0

When i enable the directoryperdb option in the mongo.conf file, mongodb server service doesn't start.

2020-03-16T15:37:55.300+0530 I  CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'

2020-03-16T15:37:55.671+0530 I  CONTROL  [main] Trying to start Windows service 'MongoDB'

2020-03-16T15:37:55.672+0530 I  CONTROL  [initandlisten] MongoDB starting : pid=8776 port=27017 dbpath=C:\Program Files\MongoDB\Server\4.2\data 64-bit host=GGNUVBRESSCHINL

2020-03-16T15:37:55.672+0530 I  CONTROL  [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2

2020-03-16T15:37:55.672+0530 I  CONTROL  [initandlisten] db version v4.2.0

2020-03-16T15:37:55.672+0530 I  CONTROL  [initandlisten] git version: a4b751dcf51dd249c5865812b390cfd1c0129c30

2020-03-16T15:37:55.672+0530 I  CONTROL  [initandlisten] allocator: tcmalloc

2020-03-16T15:37:55.672+0530 I  CONTROL  [initandlisten] modules: none

2020-03-16T15:37:55.672+0530 I  CONTROL  [initandlisten] build environment:

2020-03-16T15:37:55.672+0530 I  CONTROL  [initandlisten]     distmod: 2012plus

2020-03-16T15:37:55.673+0530 I  CONTROL  [initandlisten]     distarch: x86_64

2020-03-16T15:37:55.673+0530 I  CONTROL  [initandlisten]     target_arch: x86_64

2020-03-16T15:37:55.673+0530 I  CONTROL  [initandlisten] options: { config: "C:\Program Files\MongoDB\Server\4.2\bin\mongod.cfg", net: { bindIp: "127.0.0.1", port: 27017 }, service: true, storage: { dbPath: "C:\Program Files\MongoDB\Server\4.2\data", directoryPerDB: true, journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "C:\Program Files\MongoDB\Server\4.2\log\mongod.log" } }

2020-03-16T15:37:55.674+0530 I  STORAGE  [initandlisten] Detected data files in C:\Program Files\MongoDB\Server\4.2\data created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.

2020-03-16T15:37:55.674+0530 I  STORAGE  [initandlisten] exception in initAndListen: InvalidOptions: Requested option conflicts with current storage engine option for directoryPerDB; you requested true but the current server storage is already set to false and cannot be changed, terminating

2020-03-16T15:37:55.675+0530 I  NETWORK  [serviceStopWorker] shutdown: going to close listening sockets...

2020-03-16T15:37:55.675+0530 I  -        [serviceStopWorker] Stopping further Flow Control ticket acquisitions.

2020-03-16T15:37:55.675+0530 I  CONTROL  [serviceStopWorker] now exiting
1

If you have existing data files you cannot change settings which affect the layout of data on disk (like directoryPerDB or directoryForIndexes).

This is indicated in the error message in your startup log:

InvalidOptions: Requested option conflicts with current storage engine option for directoryPerDB; you requested true but the current server storage is already set to false and cannot be changed, terminating

To change this option for existing deployments, you need to either mongodump and mongorestore your data (for a standalone deployment) or do a rolling upgrade via replication (for a replica set deployment).

See the documentation for diretoryPerDB for steps on how to change this option for existing standalone or replica set deployments.

|improve this answer|||||

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.