Mongodb – Error starting MongoDB on CentOS

centosmongodb

When I run the mongod --dbpath /data/db command to start MongoDB, I get the following error message:

oot@vps [/]# mongod --dbpath /data/db
2015-11-17T21:10:54.048+0000 SEVERE: terminate() called, printing stack (if implemented for platform):
0x121d451 0x121c6d8 0x7f77f06c7bd6 0x7f77f06c7c03 0x7f77f06c7d22 0x771858 0x1262158 0x121ceb9 0x76fc75 0x76ff69 0x7f77efdfbd5d 0x766529
 mongod(_ZN5mongo15printStackTraceERSo+0x21) [0x121d451]
 mongod() [0x121c6d8]
 /usr/lib64/libstdc++.so.6(+0xbcbd6) [0x7f77f06c7bd6]
 /usr/lib64/libstdc++.so.6(+0xbcc03) [0x7f77f06c7c03]
 /usr/lib64/libstdc++.so.6(+0xbcd22) [0x7f77f06c7d22]
 mongod(_ZN5boost15throw_exceptionINS_21thread_resource_errorEEEvRKT_+0x1c8) [0x771858]
 mongod(_ZN5boost6thread12start_threadEv+0x138) [0x1262158]
 mongod(_ZN5mongo27startSignalProcessingThreadEv+0x299) [0x121ceb9]
 mongod() [0x76fc75]
 mongod(main+0x9) [0x76ff69]
 /lib64/libc.so.6(__libc_start_main+0xfd) [0x7f77efdfbd5d]
 mongod() [0x766529]

I am new to MondoDB and Linux servers, so really not sure where to start with this, there doesn't seem to be any usefull info in the error.

Has anyone else had anything similar? Or any ideas on where to start with fixing it?

Best Answer

In my case this turned out to be caused by not enough memory

I concluded this after running some of the commands found in this article: http://www.cyberciti.biz/faq/linux-check-memory-usage/

egrep --color 'Mem|Cache|Swap' /proc/meminfo will output how much memory is available. Don't forget that Mongo itself will require memory, so even if you have got a bit of free mem, it may not be enough.

I restarted my server, which killed a few of the memory sucking processes, and this for now has solved my problem.