mongoDB: shutting down with code:100

以你之姓@ 2022-06-08 10:24 215阅读 0赞

在使用mongodb的时候,出现如下异常:

2017-09-22T11:36:26.663+0800 I STORAGE [initandlisten] exception in initAndListen:72 Requested option conflicts with current storage engine option for directoryPerDB; you requested false but the current server storage is already set to true and cannot be changed

解决方法:

1.以管理员身份进入dos

win+s,输入cmd,鼠标右键选择“以管理员身份运行”,然后切到mongodb的bin目录下

2. remove 掉原有的服务

  1. F:\mongoDB\bin>mongod --remove

3. 去掉—directoryperdb

  1. F:\mongoDB\bin>mongod --config F:\mongoDB\data\mongod.cfg --serviceName MongoDB --intall(如果没有mongod.cfg文件,请看下面的配置)
  2. 注:
  3. 配置mongod.cfg文件-->直接在data目录下创建名为mongod.cfg文件,内容如下:
  4. ## 数据库文件目录
  5. dbpath=F:/mongoDB/data
  6. ## 日志目录
  7. logpath=F:/mongoDB/log/mongo.log
  8. diaglog=3

4.net start MongoDB

发表评论

表情:
评论列表 (有 0 条评论,215人围观)

还没有评论,来说两句吧...

相关阅读