● mongod.service - MongoDB Database Server Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled) Active: failed (Result: exit-code) since Mon 2020-04-20 13:32:29 IST; 6min ago Docs: https://docs.mongodb.org/manual Process: 27917 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=14) Main PID: 27917 (code=exited, status=14) Apr 20 13:32:29 manojkumar systemd[1]: Started MongoDB Database Server. Apr 20 13:32:29 manojkumar systemd[1]: mongod.service: Main process exited, code=exited, status=14/n/a Apr 20 13:32:29 manojkumar systemd[1]: mongod.service: Failed with result 'exit-code'.
We found that the reason for this error was the dbpath variable in /etc/mongodb. conf. Previously, the default value for dbpath was /data/db. The upstart job mongodb(which comes with mongodb-10gen package) invokes the mongod with –config /etc/mongodb.
Ensure that your MongoDB instance is running: Compass must connect to a running MongoDB instance. Also check you have installed MongoDB and have a running mongod process. You should also check that the port where MongoDB is running matches the port you provide in the compass connect.
This error comes because after installing the MongoDB database we also need to set the path of MongoDB in the system environment variable. So to resolve this error you need to follow the below steps: Open that folder where you install MongoDB. Open MongoDB folder till bin folder where mongod.exe file and copy the path.
Right-click on the setup and select Run as Administrator to install MongoDB using administrator rights. In case you cannot find an Administrative account on your PC, try to enable a hidden admin account. 1. Go to the Search bar to type in 'command prompt'.
It looks like mongo db fails to startup, usually it can be because the lack of permissions on mongodb's internal folders.
Try to check/set:
chown -R mongodb:mongodb /var/lib/mongodb
chown mongodb:mongodb /tmp/mongodb-27017.sock
I've found the thread that talks about here
To whoever comes here with the same problem of not able to start mongodb with the command (sudo systemctl status mongod) after successful installation:
I had to set ulimit -n 64000 to get it to work. This is actually mentioned in the installation docs here which I had ignored initially.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With