0

My mongod service crashes within 2-5 seconds of starting. I don't understand why.

Here are the systemctl logs:

systemctl status mongod.service

mongod.service - High-performance, schema-free document-oriented database
Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2016-05-05 11:43:57 UTC; 4min 40s ago
Process: 7597 ExecStart=/usr/bin/mongod $OPTIONS run (code=exited, status=0/SUCCESS)
Main PID: 7601 (code=exited, status=14)

May 05 11:43:52 database13.choozon.net systemd[1]: Starting High-performance, schema-free document-oriented database...
May 05 11:43:52 database13.choozon.net mongod[7597]: warning: bind_ip of 0.0.0.0 is unnecessary; listens on all ips by default
May 05 11:43:52 database13.choozon.net mongod[7597]: about to fork child process, waiting until server is ready for connections.
May 05 11:43:52 database13.choozon.net mongod[7597]: forked process: 7601
May 05 11:43:54 database13.choozon.net systemd[1]: Started High-performance, schema-free document-oriented database.
May 05 11:43:57 database13.choozon.net systemd[1]: mongod.service: Main process exited, code=exited, status=14/n/a
May 05 11:43:57 database13.choozon.net systemd[1]: mongod.service: Unit entered failed state.
May 05 11:43:57 database13.choozon.net systemd[1]: mongod.service: Failed with result 'exit-code'.

So far I have:

  • checked permissions (everything looks good)
  • checked the service
  • tried deleting mongo.lock

mongod appears to start without any errors, but then fails after a couple of seconds.

Any ideas ?

  • Can you check the disk space available in dbpath? Also, good to check memory – Atish May 6 '16 at 5:31
  • 3
    Have you checked the mongod log for errors? What are your specific versions for MongoDB and O/S, and how did you install MongoDB? – Stennie May 11 '16 at 17:58
  • 2
    The systemctl output indicates (code=exited, status=14) as a shutdown reason, which means an unrecoverable error was encountered. There should be more detailed information in your mongod log. – Stennie May 11 '16 at 18:09
-1

Search for mongod.lock and remove it and restart the service.

  1. Find out the Mongo data path cat /etc/mongod.conf | grep dbPath
  2. Look for mongod.lock file in it.
  3. If its there then delete the file and restart the server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.