I installed mongodb following this tutorial here, no errors during the installation but when I try to start the mongod server using this command sudo systemctl start m
because the permission setting
chown -R mongodb:mongodb /var/lib/mongodb
chown mongodb:mongodb /tmp/mongodb-27017.sock
if this worked for me after reinstalling mongodb. I have created manually
sudo mkdir /var/lib/mongodb
sudo mkdir /var/log/mongodb
and changed owner for both
sudo chown -R mongodb:mongodb /var/lib/mongodb
chown -R mongodb:mongodb /var/log/mongodb
This error returned by MongoDB applications which encounter an unrecoverable error, an uncaught exception or uncaught signal. The system exits without performing a clean shutdown.
I solved the problem by the command:
sudo chown -R mongodb:mongodb /var/log/mongodb
sudo chown -R mongodb:mongodb /var/lib/mongodb
sudo chmod -R 755 /var/lib/mongodb
sudo chmod -R 755 /var/log/mongodb
sudo chown mongodb /tmp/mongodb-27017.sock
sudo chgrp mongodb /tmp/mongodb-27017.sock
Then restart service
sudo systemctl restart mongod
Then check your mongodb service
sudo systemctl status mongod
The problem may be related to the lack of space with your /dev/root/
(it was mine).
Check with df -h
and see if there enough free space.
Otherwise, as explain there, try to free some space by moving the log files to another disk.
sudo /etc/init.d/rsyslog stop
sudo mv /var/log /OTHERDISK/
sudo ln -s /OTHERDISK/log /var/log
sudo /etc/init.d/rsyslog start
Hope it could help as it helps me
I had same use ,
get solve just
sudo reboot
After googling around for a while. I found that that is because the permission setting on /var/lib/mongodb and /tmp/mongodb-27017.lock are wrong. You will have to change the owner to monogdb user
chown -R mongodb:mongodb /var/lib/mongodb
chown mongodb:mongodb /tmp/mongodb-27017.sock
Recently i have solved the same issue. I was unable to find the solution on googled, but i get come clues to, how get figure it out. In my case this issue was related to mongodb-27017.sock file.
Failed to unlink socket file /tmp/mongodb-27017.sock errno:1 Operation not permitted
So i have changed the permission of /tmp/mongodb-27017.sock file to default mongodb
user.
sudo chown mongodb /tmp/mongodb-27017.sock
sudo chgrp mongodb /tmp/mongodb-27017.sock
After this sudo systemctl status mongodb
working fine and mongodb
is started.