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?
By default, MongoDB listens for connections from clients on port 27017 , and stores data in the /data/db directory. On Windows, this path is on the drive from which you start MongoDB. For example, if you do not specify a --dbpath , starting a MongoDB server on the C:\ drive stores all data files in C:\data\db .
The main purpose of mongod is to manage all the MongoDB server tasks. For instance, accepting requests, responding to client, and memory management. mongo is a command line shell that can interact with the client (for example, system administrators and developers).
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With