Mongodb not working on Ubuntu 16.04

前端 未结 11 924
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-28 15:51

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

相关标签:
11条回答
  • 2020-12-28 16:27

    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
    
    0 讨论(0)
  • 2020-12-28 16:28

    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
    
    0 讨论(0)
  • 2020-12-28 16:28

    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

    0 讨论(0)
  • 2020-12-28 16:29

    I had same use ,

    get solve just

    sudo reboot
    
    0 讨论(0)
  • 2020-12-28 16:29

    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
    
    0 讨论(0)
  • 2020-12-28 16:31

    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.

    0 讨论(0)
提交回复
热议问题