Mongo 3.0.1数据库验证/连接问题。 Mongo控制台是的,其他一切都没有

时间:2015-04-02 20:11:37

标签: mongodb authentication mongovue robo3t

我在Windows 7 Pro 64bit上安装了MongoDB 3.0.1。我正在做的一切都是在这台服务器上完成的,所有连接都通过127.0.0.1:27017。是的,我已经应用了MongoDB建议做的MS Hotfix。这是我的完整配置文件:

systemLog:
   destination: file
   path: "C:\\Program Files\\MongoDB\\Server\\3.0\\data\\log\\mongod.log"
   logAppend: true
storage:
   dbPath: "C:\\Program Files\\MongoDB\\Server\\3.0\\data\\db"
security:
   authorization: enabled

我创建了一个像这样的超级用户:

db.createUser({user:"superuser", pwd:"temp",
roles:[ "userAdminAnyDatabase", "readWrite" ] } )

我可以像这样登录mongo控制台:

mongo.exe 127.0.0.1:27017/admin  -u superuser -p temp --authenticationDatabase admin --verbose

然后我可以从mongo控制台进行操作。但是,当我尝试连接Mongovue或Robomongo等管理员用户界面时,我拒绝连接。 Mongovue吐出这个堆栈跟踪:

Connection was refused
Unable to connect to server 127.0.0.1:27017: Object reference not set to an instance of an object..
Type: MongoDB.Driver.MongoConnectionException
Stack:    at MongoDB.Driver.Internal.DirectMongoServerProxy.Connect(TimeSpan timeout, ReadPreference readPreference)
   at MongoDB.Driver.MongoServer.Connect(TimeSpan timeout)
   at MongoDB.Driver.MongoServer.Connect()
   at MangoUI.MMongo.QSDlL5xzK686iCExThO(Object )
   at MangoUI.MMongo.Open(Boolean mustWrite)
   at MangoUI.MMongo.Open()
   at MangoUI.MConnection.get_IsValid()
   at MangoUI.WinConnect.SCOjR9kYRPerNNngykW(Object )
   at MangoUI.WinConnect.btnTest_Click(Object sender, EventArgs e)


Object reference not set to an instance of an object.
Type: System.NullReferenceException
Stack:    at MongoDB.Driver.MongoServerInstance.RefreshStateAsSoonAsPossible()
   at MongoDB.Driver.Internal.MongoConnection.HandleException(Exception ex)
   at MongoDB.Driver.Internal.MongoConnection.SendMessage(BsonBuffer buffer, Int32 requestId)
   at MongoDB.Driver.Internal.MongoConnection.SendMessage(MongoRequestMessage message)
   at MongoDB.Driver.Operations.CommandOperation`1.Execute(MongoConnection connection)
   at MongoDB.Driver.MongoServerInstance.RunCommandAs[TCommandResult](MongoConnection connection, String databaseName, IMongoCommand command)
   at MongoDB.Driver.MongoServerInstance.Ping(MongoConnection connection)
   at MongoDB.Driver.MongoServerInstance.Connect()
   at MongoDB.Driver.Internal.DirectMongoServerProxy.Connect(TimeSpan timeout, ReadPreference readPreference)

这看起来像是指向我的空指针。我错过了某处的配置吗?我需要做些什么才能让它发挥作用?

谢谢,

沃伦

1 个答案:

答案 0 :(得分:4)

我猜答案很简单,Mongovue和Robomongo还不支持Mongo DB 3.0.1。我没有问题让Mongo控制台连接和3T MongoChef连接。现在我想我需要确保Mongoose是好的。