directoryperDB не работает под WiredTiger Storage Engine - PullRequest
0 голосов
/ 17 марта 2020

Когда я включаю опцию directoryperdb в файле mon go .conf, служба сервера mongodb не запускается.

В нем говорится directotyperdb value can't be true.

Это мон go журналов: -

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 Ответ

0 голосов
/ 17 марта 2020

Если сервер уже был запущен ранее без этого параметра, вы не сможете изменить его впоследствии, это потому, что файлы метаданных уже есть, если вы в порядке, удаляя данные, вы удаляете содержимое папки данных и пробуете его. снова, это будет работать.

Согласно документации, если вы хотите сделать это для существующего сервера, вам нужно будет сделать следующее:

Чтобы изменить опцию storage.directoryPerDB для существующих развертываний:

For standalone instances:
Use mongodump on the existing mongod instance to generate a backup.
Stop the mongod instance.
Add the storage.directoryPerDB value and configure a new data directory
Restart the mongod instance.
Use mongorestore to populate the new data directory.
For replica sets:
Stop a secondary member.
Add the storage.directoryPerDB value and configure a new data directory to that secondary member.
Restart that secondary.
Use initial sync to populate the new data directory.
Update remaining secondaries in the same fashion.
Step down the primary, and update the stepped-down member in the same fashion.

Это объясняется здесь: https://docs.mongodb.com/manual/reference/configuration-options/#storage .directoryPerDB

...