Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR: child process failed, exited with error number 51 MongoDB

Tags:

mongodb

Getting this error while restarting MongoDB , I am using Mongo 3.2.4 and doing this set up on a new machine

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  -----
like image 210
Ankit Avatar asked May 09 '17 17:05

Ankit


2 Answers

For me this error occured due to incorrect ownership of some files in my data directory. I fixed this using the following command:

sudo chown -R mongodb: /path/to/db/directory

Where mongodb was the database user in my case.

like image 198
Michael Armitage Avatar answered Nov 13 '22 11:11

Michael Armitage


This is resolved by inserting the following lines into /etc/security/limits.conf:

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

We need to add the user account used to run the Mongo service. Generally, it is the mongodb user.

like image 1
Ankit Avatar answered Nov 13 '22 10:11

Ankit