-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.7.3
-
Component/s: Cluster Management
-
Environment:Mac OS 10.7.3
mongodb 2.0.2
java-driver 2.7.3
I set up a sharded cluster with every mongod process started with "--keyFile" option.
mongos: port 27017
config: port 27019
mongod: shard1 primary port 27200
mongod: shard1 secondary port 27201
mongod: shard2 primary port 27202
mongod: shard2 secondary port 27203
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 without authentication.