电表上传 碰到 mongodb宕机,出现异常
现象:

真正原因:mongodb挂掉后,处理不当。
C# mongodb down机 超时30秒。200多个调表,导致采集堵塞,datatable索引也坏了。
上传数据失败:System.TimeoutException: A timeout occurred after 30000ms selecting a server using CompositeServerSelector{ Selectors = WritableServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 }, OperationsCountServerSelector }. Client view of cluster state is { ClusterId : "1", Type : "ReplicaSet", State : "Connected", Servers : [{ ServerId: "{ ClusterId : 1, EndPoint : "10.17.19.26:27017" }", EndPoint: "10.17.19.26:27017", ReasonChanged: "Heartbeat", State: "Connected", ServerVersion: 7.0.0, TopologyVersion: { "processId" : { "$oid" : "68462f4cda015951f044ac61" }, "counter" : 6 }, Type: "ReplicaSetSecondary", WireVersionRange: "[0, 21]", LastHeartbeatTimestamp: "2025-06-21T16:00:16.8807517Z", LastUpdateTimestamp: "2025-06-21T16:00:16.8807519Z" }, { ServerId: "{ ClusterId : 1, EndPoint : "10.17.19.26:27017" }", EndPoint: "10.17.19.26:27017", ReasonChanged: "Heartbeat", State: "Disconnected", ServerVersion: , TopologyVersion: , Type: "Unknown", HeartbeatException: "MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server.

浙公网安备 33010602011771号