Mongodb错误 – 超出文件描述符。 等待一秒钟,然后再尝试接受更多的连接

细节

这是我在日志文件中看到的

2014-09-08T10:22:43.143+0000 [initandlisten] ERROR: Out of file descriptors. Waiting one second before trying to accept more connections. 2014-09-08T10:22:43.360+0000 [conn9206] Assertion: 12520:new file allocation failure 

系统资源限制详情

ulimit -a

 max memory size (kbytes, -m) unlimited open files (-n) 1024 

系统详情

Ubuntu 12.04 LTS

MongoDB版本

2.6.1

也,

lsof -p mongopid

2028打开文件描述符

任何人都可以帮助..? 我在我的生产服务器上反复得到这个..看着谷歌..发现这个mongo问题closures –

https://jira.mongodb.org/browse/SERVER-6734

看起来你打开的文件太less了。 您必须在以下configuration文件中添加一些行(并将mongouser更改为运行MongoDB的用户名):

在/etc/security/limits.conf

 mongouser soft nofile 32768 mongouser hard nofile 65535 

/etc/sysctl.conf中

 fs.file-max = 500000 

/etc/pam.d/login文件

 session required pam_limits.so 

/home/mongouser/.bashrc

 ulimit -n 63535 

重新启动服务器后,新的限制将到位。