Unable to change the dbpath in mongodb through mongodb.conf

拜拜、爱过 提交于 2019-12-07 00:06:51

问题


I am getting the following message
exception in initAndListen std::exception: boost::filesystem::exists: Permission denied: "/vol/mongodb", terminating

in /var/log/mongodb/mongodb.log

ls -al /vol/mongodb gives -
drwxrwxrwx 2 mongodb mongodb 4096 2011-08-07 12:10 ./

When I change the dbpath, back to the default, which is /var/lib/mongodb - it works fine.

How do I solve this?


回答1:


I had the same problem initially and found it was caused by the mongodb user not having appropriate permissions on the parent directory.

I'd recommend checking /vol to ensure that the mongodb user can at least read files from that directory. May also need execute permissions too, and I suspect this will hold for each subsequent parent directory up to root.



来源:https://stackoverflow.com/questions/6971634/unable-to-change-the-dbpath-in-mongodb-through-mongodb-conf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!