Error information:
“Job for mongod.service failed. See 'systemctl status mongod.service' and 'journalctl -xn' for details.”
I had this issue on different occasions for different reasons:
/var/lib/mongod.lock file – The last time mongod stopped it didn’t get a chance to close the database. This leaves a file in your database folder called mongod.lock
. Inside the folder is a number (I believe it’s the PID that mongo was using last). If this file exists you will not be able to start the mongod service. Delete the file and try again.
/tmp/mongodb-27017.sock — Delete the file and try again.