Unable to create/open lock file: /data/mongod.lock errno:13 Permission denied

前端 未结 28 1446
执念已碎
执念已碎 2020-11-29 14:39

How to I get mongo to use a mounted drive on ec2? I really do not understand. I attached a volume on ec2 formatted the drive as root and start as root and yet as root I ca

相关标签:
28条回答
  • 2020-11-29 15:13

    I got the same issue when I ran mongod command after installing it on Windows10. I stopped the mongodb service and started it again. Working like a charm

    Command to stop mongodb service (in windows): net stop mongodb

    Command to start mongodb server: mongod --dbpath PATH_TO_DATA_FOLDER

    0 讨论(0)
  • 2020-11-29 15:13

    In Centos Server

    this works for me

    chown -R mongod:mongod /var/lib/mongo
    
    0 讨论(0)
  • 2020-11-29 15:13

    Got a similar error, fixed with removing all records (in my case directory journals, and file mongo.lock...), after that check port with sudo lsof -i:27017, if smth running on it kill <PID of the process>, and try to run ./mongod again

    0 讨论(0)
  • 2020-11-29 15:14

    I installed mongodb with EBS on an EC2 with Ubuntu 14.04 following this tutorial:

    http://docs.mongodb.org/ecosystem/platforms/amazon-ec2/

    But instead of the suggested chown I did:

    sudo chown -R mongodb:mongodb /data /log /journal
    

    To fix the problem

    0 讨论(0)
  • 2020-11-29 15:14

    For mac users:
    Run ls -ld /data/db/
    Output should be something like drwrx-xr-x 20 singh wheel 680 21 Jul 05:49 /data/db/
    Where singh is the owner and wheel is the group it belongs to.
    Run sudo chown -R singh:wheel /data/db
    Run mongod

    0 讨论(0)
  • 2020-11-29 15:17

    Do ls -lato know the user and group of /var/log/mongodb. Then do sudo chown -R user:group /data/db Now run sudo service mongodb start. Check the status with sudo service mongodb status

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