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

前端 未结 28 1444
执念已碎
执念已碎 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:17

    On windows be sure the console is started as aministrator

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

    Every time you when you try to start mongod just type

    sudo mongod
    

    or if permanently want to fix this just try to give rwx premission to /data/db folder

     chmod +rwx data/
    
    0 讨论(0)
  • 2020-11-29 15:18

    For me on CentOS 6.x:

    sudo chown -R mongodb:mongodb <db-path> sudo service mongod restart

    And I have set a custom db-path in /etc/mongod.conf.

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

    In my case the issue was solved by removing the log file.

    sudo rm /log/mongod.log
    

    Although the error message refers specifically to the lock file:

    exception in initAndListen: 10309 Unable to create/open lock file: 
    /data/mongod.lock errno:13 Permission denied 
    Is a mongod instance already running?, terminating
    
    0 讨论(0)
提交回复
热议问题