Search code examples
mongodbbitnami

SocketException: Error connecting to /opt/bitnami/mongodb/tmp/mongodb-27017.sock in ubuntu server


I'm using Amazon AWS Lightsail. I have a MEAN stack application. It was running smoothly since the last couple of months.

Suddenly I got this error:

Error connecting to /opt/bitnami/mongodb/tmp/mongodb-27017.sock

How do I restart mongodb?

I tried the below command:

sudo service mongodb status

I got below response:

mongodb.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)

What could be the reason? Did my DB crash, if yes, how do I repair or reset it?


Solution

  • Bitnami Engineer here. You can easily restart all the Bitnami services by running this command

    sudo /opt/bitnami/ctlscript.sh restart
    

    If you want to restart the MongoDB service only, append mongodb to the command.

    https://docs.bitnami.com/aws/infrastructure/mean/administration/control-services/

    Regarding the MongoDB error, you can obtain more information from its log file (/opt/bitnami/mongodb/log/mongodb.log)

    https://docs.bitnami.com/aws/infrastructure/mean/get-started/understand-default-config/