C#Mongo驱动程序:超时,连接被服务器拒绝(奇怪的行为)

时间:2018-04-06 02:51:34

标签: c# mongodb timeout mongodb-.net-driver connection-refused

我正在使用Mongo DB 3.4.2,从API访问数据时遇到一个奇怪的问题。错误消息显示:

"ClassName": "System.TimeoutException",
    "Message": "A timeout occured after 30000ms selecting a server usingCompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster state is { ClusterId : \"1\", ConnectionMode : \"Automatic\", Type : \"Standalone\", State : \"Disconnected\", Servers : [{ ServerId: \"{ ClusterId : 1, EndPoint : \"ServerIp:27017\" }\", EndPoint: \"ServerIp:27017\", State: \"Disconnected\", Type: \"Unknown\", HeartbeatException: \"MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server. ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it

正如您所看到的问题所示:“由于目标计算机主动拒绝连接,因此无法建立连接”,我们已经验证了以下内容:

  • 服务器上没有阻止端口。
  • 防火墙没有阻止 港口。
  • 流程中没有代理涉及

通过重新启动服务器上的Mongo Db服务解决了该问题,但重新启动服务后每1小时出现同样的问题。

有人可以帮我解决这个问题,

由于

0 个答案:

没有答案