无法通过mongodb.conf更改mongodb中的dbpath [英] Unable to change the dbpath in mongodb through mongodb.conf
问题描述
我收到以下消息
initAndListen std :: exception:boost :: filesystem :: exists中的异常:权限被拒绝:"/vol/mongodb",终止
I am getting the following message
exception in initAndListen std::exception: boost::filesystem::exists: Permission denied: "/vol/mongodb", terminating
/var/log/mongodb/mongodb.log
in /var/log/mongodb/mongodb.log
ls -al/vol/mongodb给出-
drwxrwxrwx 2 mongodb mongodb 4096 2011-08-07 12:10 ./
ls -al /vol/mongodb gives -
drwxrwxrwx 2 mongodb mongodb 4096 2011-08-07 12:10 ./
当我更改dbpath时,将其恢复为默认值,即/var/lib/mongodb-它可以正常工作.
When I change the dbpath, back to the default, which is /var/lib/mongodb - it works fine.
我该如何解决?
推荐答案
最初我遇到相同的问题,发现这是由mongodb
用户对父级目录没有适当权限引起的.
I had the same problem initially and found it was caused by the mongodb
user not having appropriate permissions on the parent directory.
我建议检查/vol
以确保mongodb
用户至少可以从该目录读取文件.可能还需要执行权限,我怀疑此权限将保留在每个后续的父目录中,直到根目录为止.
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.
这篇关于无法通过mongodb.conf更改mongodb中的dbpath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!