I'm using GNU/LInux 4.4 on asw and I want to run a mongodb server (v3.4.3)
When I do the follwoing command, I can run the server and everything works:
sudo mongod --config /etc/mongod.confI see in the log file that the service is actively running and everything is fine.
When I try to run it as a service (I believe this is the recommended way in production) I get a permission error message
sudo service mongod startIn the log file I then get this error:
assertion: 28595:13: Permission denied src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 267I have two questions:
- Why do I get this error and what can I do about it?
- When I run it as a service, it doesn't seem to be necessary to specify the config file, but he seems to read it correctly, as he writes the error message to the log file, which is specified in the config file. How does he automatically know which config file to use when I run it as a service?
1 Answer
I've had the same issue. I solved it by:
- removing the
mongod.lockfile under your data folder (in my case is/data/mongodb/) - changing the permissions:
sudo chown -R mongodb:mongodb /data/mongodb/ - and several reboots..
Take a look at this answer on Stack Overflow which could be informative.