繁体   English   中英

MongoDB:System.TimeoutException:使用 CompositeServerSelector 选择服务器 30000 毫秒后发生超时

[英]MongoDB: System.TimeoutException: A timeout occured after 30000ms selecting a server using CompositeServerSelector

我正在尝试对在 MongoDB 中缓存数据的端点运行我的请求。 但是,当我运行请求时,它超时并出现以下错误:

A timeout occured after 30000 ms selecting a server using CompositeServerSelector 
{
    Selectors = ReadPreferenceServerSelector {
        ReadPreference = {
            Mode: Primary
        }
    }, 
    LatencyLimitingServerSelector {
        AllowedLatencyRange = 00: 00: 00.0150000
    }
}.Client view of cluster state is {
    ClusterId: "1",
    ConnectionMode: "ReplicaSet",
    Type: "ReplicaSet",
    State: "Connected",
    Servers: [{
        ServerId: "{ ClusterId : 1, EndPoint : "
        Unspecified / devtest - bus - 01: 27017 " }",
        EndPoint: "Unspecified/devtest-bus-01:27017",
        State: "Disconnected",
        Type: "Unknown",
        LastUpdateTimestamp: "2019-10-21T07:26:11.0447873Z"
    }, {
        ServerId: "{ ClusterId : 1, EndPoint : "
        Unspecified / devtest - bus - 02: 27017 " }",
        EndPoint: "Unspecified/devtest-bus-02:27017",
        State: "Connected",
        Type: "ReplicaSetSecondary",
        WireVersionRange: "[0, 7]",
        LastUpdateTimestamp: "2019-10-21T07:26:11.1367767Z"
    }, {
        ServerId: "{ ClusterId : 1, EndPoint : "
        Unspecified / devtest - bus - 03: 27017 " }",
        EndPoint: "Unspecified/devtest-bus-03:27017",
        State: "Connected",
        Type: "ReplicaSetSecondary",
        WireVersionRange: "[0, 7]",
        LastUpdateTimestamp: "2019-10-21T07:26:11.5579411Z"
    }]
}

我不确定为什么服务器 devtest-bus-01 的 state 断开连接。 当我在 Robo T3 中打开副本集时,似乎一切都按预期工作。

我们的连接字符串在代码中是正确的:

"Caching": {
    "ConnectionString": "mongodb://devtest-bus-01:27017,devtest-bus-02:27017,devtest-bus-03:27017/?replicaSet=rs0"
},

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM