错误:子进程失败,退出错误号为51 MongoDB

重新启动MongoDB时出现此错误,我正在使用Mongo 3.2.4并在新计算机上进行此设置

Starting mongod... about to fork child process, waiting until server is ready for connections.
forked process: 19438
ERROR: child process failed, exited with error number 51
 mongod(_ZN5mongo19MmapV1ExtentManager4initEPNS_16OperationContextE+0x4A8) [0x1040278]
 mongod(_ZN5mongo26MMAPV1DatabaseCatalogEntryC1EPNS_16OperationContextENS_10StringDataES3_bb+0x187) [0x1036dc7]
 mongod(_ZN5mongo12MMAPV1Engine23getDatabaseCatalogEntryEPNS_16OperationContextENS_10StringDataE+0x14E) [0x103a1de]
 mongod(_ZN5mongo14DatabaseHolder6openDbEPNS_16OperationContextENS_10StringDataEPb+0x133) [0xac92a3]

-----  END BACKTRACE  -----

最佳答案 通过在/etc/security/limits.conf中插入以下行来解决此问题:

mongodb      soft    nofile          65535
mongodb      hard    nofile          90000
mongodb      soft    nproc           65535
mongodb      hard    nproc           90000

我们需要添加用于运行Mongo服务的用户帐户.通常,它是mongodb用户.

点赞