您的位置:首页 > 数据库 > Mongodb

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

2016-07-25 21:49 513 查看
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.localdomain
2016-07-21T02:47:14.020-0700 I CONTROL  [initandlisten] db version v3.2.8
2016-07-21T02:47:14.020-0700 I CONTROL  [initandlisten] git version: ed70e33130c977bda0024c125b56d159573dbaf0
2016-07-21T02:47:14.020-0700 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
2016-07-21T02:47:14.020-0700 I CONTROL  [initandlisten] allocator: tcmalloc
2016-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: rhel62
2016-07-21T02:47:14.020-0700 I CONTROL  [initandlisten]     distarch: x86_64
2016-07-21T02:47:14.020-0700 I CONTROL  [initandlisten]     target_arch: x86_64
2016-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, terminating
2016-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服务,导入导出的数据;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: