码迷,mamicode.com
首页 > 其他好文 > 详细

Insufficient free space for journal files

时间:2015-09-06 09:45:39      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:

   前两天请假了,公司的很多app突然挂掉了,说是mongodb莫名的挂掉了,赶紧进去看了看日志:

2015-08-31T14:06:20.070+0800 [initandlisten] ERROR: Insufficient free space for journal files
2015-08-31T14:06:20.070+0800 [initandlisten] Please make at least 3379MB available in /data/mongodb/data/journal or use --smallfiles
2015-08-31T14:06:20.070+0800 [initandlisten] 
2015-08-31T14:06:20.070+0800 [initandlisten] exception in initAndListen: 15926 Insufficient free space for journals, terminating
2015-08-31T14:06:20.070+0800 [initandlisten] dbexit: 
2015-08-31T14:06:20.071+0800 [initandlisten] shutdown: going to close listening sockets...
2015-08-31T14:06:20.071+0800 [initandlisten] shutdown: going to flush diaglog...
2015-08-31T14:06:20.071+0800 [initandlisten] shutdown: going to close sockets...
2015-08-31T14:06:20.071+0800 [initandlisten] shutdown: waiting for fs preallocator...
2015-08-31T14:06:20.071+0800 [initandlisten] shutdown: lock for final commit...
2015-08-31T14:06:20.071+0800 [initandlisten] shutdown: final commit...
2015-08-31T14:06:20.071+0800 [initandlisten] shutdown: closing all files...
2015-08-31T14:06:20.071+0800 [initandlisten] closeAllFiles() finished
2015-08-31T14:06:20.071+0800 [initandlisten] journalCleanup...
2015-08-31T14:06:20.071+0800 [initandlisten] removeJournalFiles
2015-08-31T14:06:20.075+0800 [initandlisten] shutdown: removing fs lock...
2015-08-31T14:06:20.075+0800 [initandlisten] dbexit: really exiting now

查了查,原来是因为mongodb对硬盘的增长是以倍数增长的,每次增加2G,查了查服务器的硬盘空间,我去,剩下1.8G了

看到错误日志中解决的办法是使用 --smallfiles参数,然后我就试了试

./mongod --dbpath /data/mongodb/data --logpath /data/mongodb/mongodb.log --smallfiles

好是好了,可是一直在输出log,只要一终止,mongodb就又挂了,然后看了看mongodb的参数。找到了一个 --fork ,创建一个子进程参数。好的

./mongod --dbpath /data/mongodb/data --logpath /data/mongodb/mongodb.log --smallfiles --fork

搞定~~

 

 

  

Insufficient free space for journal files

标签:

原文地址:http://www.cnblogs.com/qiangweikang/p/mongodb_01.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!