MongoDB 3.2配置文件directoryPerDB参数,无法重启

来源:互联网 发布:java sha1解密 编辑:程序博客网 时间:2024/06/07 19:00

MongoDB3.2 使用过一段时间之后,想要配置下directoryPerDB参数,于是在mongod.conf配置文件storage下加入:

  directoryPerDB: true

服务重启时报错信息如下:

2016-07-21T02:47:14.007-0700 I CONTROL  [main] ***** SERVER RESTARTED *****2016-07-21T02:47:14.020-0700 I CONTROL  [initandlisten] MongoDB starting : pid=2740 port=27017 dbpath=/home/martin/mongodb/db 64-bit host=localhost.localdomain2016-07-21T02:47:14.020-0700 I CONTROL  [initandlisten] db version v3.2.82016-07-21T02:47:14.020-0700 I CONTROL  [initandlisten] git version: ed70e33130c977bda0024c125b56d159573dbaf02016-07-21T02:47:14.020-0700 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 20132016-07-21T02:47:14.020-0700 I CONTROL  [initandlisten] allocator: tcmalloc2016-07-21T02:47:14.020-0700 I CONTROL  [initandlisten] modules: enterprise 2016-07-21T02:47:14.020-0700 I CONTROL  [initandlisten] build environment:2016-07-21T02:47:14.020-0700 I CONTROL  [initandlisten]     distmod: rhel622016-07-21T02:47:14.020-0700 I CONTROL  [initandlisten]     distarch: x86_642016-07-21T02:47:14.020-0700 I CONTROL  [initandlisten]     target_arch: x86_642016-07-21T02:47:14.020-0700 I CONTROL  [initandlisten] options: { config: "/home/martin/mongodb/bin/mongod.conf", net: { bindIp: "0.0.0.0", port: 27017 }, processManagement: { fork: true, pidFilePath: "/home/martin/mongodb/mongod.pid" }, security: { authorization: "enabled" }, storage: { dbPath: "/home/martin/mongodb/db", directoryPerDB: true, journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "/home/martin/mongodb/logs/mongod.log" } }2016-07-21T02:47:14.041-0700 I -        [initandlisten] Detected data files in /home/martin/mongodb/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.2016-07-21T02:47:14.042-0700 I STORAGE  [initandlisten] exception in initAndListen: 72 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, terminating2016-07-21T02:47:14.042-0700 I CONTROL  [initandlisten] dbexit:  rc: 100

根据错误日志提示:

[initandlisten] exception in initAndListen: 72 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

初始化失败,当前directoryPerDB选项存储引擎有72个选项冲突,你要求true,但是当前存储服务已经设置为false,并且无法改变,程序终止。

解决办法:
1、删除dbPath文件夹下所有文件,重启MongoDB服务;
2、导出MongoDB 存储文件,删除dbPath文件夹下所有文件,重启MongoDB服务,导入导出的数据;

0 0
原创粉丝点击