MongoDB报错Insufficient free space for journal files的解决方法

原因: 因为journal至少以2G的数量进行增长,当磁盘空间不足时,会报错Insufficient free space for journal files.
解决方案: 在启动mongo时加上--smallfiles参数,例如: mongod --smallfiles,或者修改
/etc/mongodb.conf,找到storage.smallFiles,修改以下行:
smallfiles = true
检查配置是否生效:
> use admin
switched to db admin
> db.runCommand({getCmdLineOpts:1});

请使用浏览器的分享功能分享到微信等