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

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

    You could try by these ways. 1st.

    sudo chown -R mongod:mongod /data/db

    but at some times,this is not useful. 2nd. if the above way is not useful,you can try to do this:

    mkdir /data/db #as the database storage path

    nohup mongod --dbpath /data/db &

    or type:

    mongod --dbpath /data/db

    to get the output stream

提交回复
热议问题