Mongodb only works properly as root

70 views
Skip to first unread message

Ben Wingerter

unread,
Jun 22, 2014, 2:50:38 PM6/22/14
to mongod...@googlegroups.com
Hello. For some reason, mongod will only work properly when I run it as root.  When I run the command 'mongod --config /etc/mongod.conf' it tells me 'all output going to: /var/log/mongodb/mongod.log'.  But then when I go to run 'mongo', it will say 'MongoDB shell version: 2.4.9
connecting to: test
Sun Jun 22 13:43:09.939 Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145
exception: connect failed'

If I run the first command as root, then the 'mongo' command works perfect and I cannot to the shell.  Does anyone know what might be wrong?

Ben Wingerter

unread,
Jun 22, 2014, 3:00:30 PM6/22/14
to mongod...@googlegroups.com
Sorry typo I meant to say on the last time: "If I run the first command as root, then the 'mongo' command works perfect and I can to the shell.  Does anyone know what might be wrong?"

Tyler Brock

unread,
Jun 22, 2014, 3:11:24 PM6/22/14
to mongod...@googlegroups.com
The ownership of the data directory is probably such that only root has the necessary permissions. If you are using linux use "chown" to change the ownership or modify the permissions accordingly.

On Jun 22, 2014, at 3:00 PM, Ben Wingerter <benwing...@gmail.com> wrote:

Sorry typo I meant to say on the last time: "If I run the first command as root, then the 'mongo' command works perfect and I can to the shell.  Does anyone know what might be wrong?"

--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/ad5fbf86-58ef-41c5-96d9-d659cbaf49fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ben Wingerter

unread,
Jun 23, 2014, 2:06:04 PM6/23/14
to mongod...@googlegroups.com

I just noticed that when I run mongod without root, the process seems to stop immediately by itself.

but when i run it as root the process doesn't stop...

it seems that something is killing the mongod process, but i'm not sure what it is.  Thanks for your help

Tyler Brock

unread,
Jun 23, 2014, 3:30:56 PM6/23/14
to mongod...@googlegroups.com
Can you paste the output of /var/log/mongodb/mongod.log?


Reply all
Reply to author
Forward
0 new messages