0

Well I've started learning MongoDB today well after a while of working and learning the basics of mongo I could not connect to MongoDB anymore

when I get the status of the mongo.service

× mongod.service - MongoDB Database Server
     Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2022-06-03 22:44:23 +0430; 7min ago
       Docs: https://docs.mongodb.org/manual
   Main PID: 23895 (code=exited, status=14)
        CPU: 626ms

Jun 03 22:44:22 user systemd[1]: Started MongoDB Database Server.
Jun 03 22:44:23 user systemd[1]: mongod.service: Main process exited, code=exited, status=14/n/a
Jun 03 22:44:23 user systemd[1]: mongod.service: Failed with result 'exit-code'.

well I searched on google and I've found the following solutions

~ sudo chown -R mongodb:mongodb /var/log/mongodb
~ sudo chown -R mongodb:mongodb /tmp/mongodb-27017.sock
~ sudo systemctl restart mongod.service 

Also, the following command returns nothing

~ netstat -an | grep 27017

I tried to reinstall the mongo-org package but still does not work :(

One more thing... i have not edit the /etc/mongo.conf

Milad Hatami
  • 1,494
  • 13
  • 18

0 Answers0