2015년 1월 1일 목요일

starting mongod as non-root user

I am using MongoDB 2.8.0-rc4 on AWS EC2. When I try to start mongod as a non-root user, I get the following message

about to fork child process, waiting until server is ready for connections.
forked process: 2503
ERROR: child process failed, exited with error number 1

No log is created. 

If I start with root then the only relevant message in the log is that I started as a root user and that it is not recommended.

I assigned mongod:mongod (user, group) to dbpath, logpath and to mongod executable as well. 

How should I start mongod as a non-root user? 

Also, how do I shutdown mongod without going through the shell? mongod --shutdown --dbpath "<path>" throws an error that there is no server running at that path when in fact there is a mongodb server running using that path.



I would double check the log directory - I'm guessing you don't have
permissions to either create new file there or move existing file to a
differently named file.

As far as killing - if this is the only mongod running on server you
can always use 'killall -w mongod'   or 'kill $(pidof mongod)'



Thank you for the response. I think log directory has the required permissions, drwxrwxr-x and it has mongod:mongod as the username and group. What else could be missing?




Fixed this. I changed the username:group of the contents of the dbpath and journal to ec2-user:ec2-user. With these changes, it worked when I started mongod as a non-root user.


댓글 없음:

댓글 쓰기