用mongovue連接時顯示:
提示框裡的程式碼如下:
Connection was refused
Unable to connect to server 127.0.0.1:27017: 由于目标计算机积极拒绝,无法连接。 127.0.0.1:27017.
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.Open(Boolean mustWrite)
at MangoUI.MMongo.Open()
at MangoUI.MConnection.get_IsValid()
at MangoUI.WinConnect.btnTest_Click(Object sender, EventArgs e)
由于目标计算机积极拒绝,无法连接。 127.0.0.1:27017
Type: System.Net.Sockets.SocketException
Stack: at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at System.Net.Sockets.TcpClient.Connect(IPEndPoint remoteEP)
at MongoDB.Driver.Internal.MongoConnection.Open()
at MongoDB.Driver.Internal.MongoConnection.GetNetworkStream()
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)
怪我咯2017-04-28 09:06:36
第一步確定你的mongo服務是否正常啟動。測試方式為在mongo所在伺服器用本地telnet
測試。排除mongo服務問題
如果第一步成立,則換成同網段內telnet
測試。如果無法訪問,檢測mongo所佔用端口是不是被防火牆或殺軟禁止了。如果是則在出入站規則中新增對應的出入站規則。排除防火牆,殺軟的問題。
最後在使用你的mongovue。