-2

I am working on EC2 aws. My mongo suddenly stopped connecting.

sudo service mongodb status displays the following:-

● mongodb.service - High-performance, schema-free document-oriented >database
   Loaded: loaded (/etc/systemd/system/mongodb.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2019-03-29 18:31:08 UTC; 1h 18min ago
 Main PID: 3773 (code=exited, status=100)

Mar 29 18:31:07 ip-172-31-41-39 systemd[1]: Started An object/document-oriented database.
Mar 29 18:31:08 ip-172-31-41-39 systemd[1]: mongodb.service: Main process exited, code=exited, status=100/n/a
Mar 29 18:31:08 ip-172-31-41-39 systemd[1]: mongodb.service: Failed with result 'exit-code'.

I read that doing sudo service mongodb start might solve your problem but I fear will it delete my data?

Shreyansh Jain
  • 433
  • 1
  • 7
  • 17
  • Possible duplicate of [MongoDb shuts down with Code 100](https://stackoverflow.com/questions/41420466/mongodb-shuts-down-with-code-100) – asdf Mar 29 '19 at 21:23

1 Answers1

0

An exit code 100 for the mongodb service means that it could not access or find the data directory. If your data directory is protected by sudo then starting the service with sudo will solve your problem.

asdf
  • 2,927
  • 2
  • 21
  • 42