question about the security of mongodb

22 views
Skip to first unread message

田毅

unread,
Feb 15, 2012, 3:50:14 AM2/15/12
to mongodb-user
hi,all

 I set up a mongodb cluster with every mongod process started with "--keyFile" option.

mongos:                                         port 27017
mongod:    shard1  primary        port 27200
mongod:    shard1  secondary   port 27201
mongod:    shard2  primary        port 27202
mongod:    shard2  secondary   port 27203
config:                                             port 27019

then, I found I can't connect to mongod and get the serverStatus via java-driver.

my code is like this:

Mongo mongo = new Mongo("localhost", 27200);
DB testDB = mongo.getDB("test");
CommandResult resp = testDB.command("serverStatus");
System.out.println(resp);

the result is :

{ "serverUsed" : "localhost:27200" , "errmsg" : "need to login" , "ok" : 0.0}


but if I run 'mongo' in my console to connect to localhost:27200, I can get the serverStatus result.


Tim

unread,
Feb 15, 2012, 4:56:13 AM2/15/12
to mongodb-user
btw version is 2.0.2

java driver version 2.7.3

Eliot Horowitz

unread,
Feb 16, 2012, 12:12:28 AM2/16/12
to mongod...@googlegroups.com
Have you read this:
http://www.mongodb.org/display/DOCS/Security+and+Authentication

I think it addresses some of your questions.

> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>

Reply all
Reply to author
Forward
0 new messages