清泛IT社区

搜索
App Inventor 2 中文社区 轻松创建Apps

扫码访问移动社区 移动社区,您的掌上技术专家

关注我,精彩不错过! 关注我,精彩不错过!

扫码安装最新版AI伴侣 最新版AI伴侣v2.69

Aia Store .aia 源码一站式解决方案 发布日志AI2连接测试ai2Starter模拟器

开通VIP送小红花App Inventor 2 拓展有奖征文 VIP会员享专有教程,免费赠送基础版*技术支持服务! AI2入门必读中文文档中文教程IoT专题

查看: 999|回复: 0
打印 上一主题 下一主题

[MongoDB] MongoDB.Driver.MongoConnectionException: Unable to connect to the primary member

  • TA的每日心情
    开心
    2024-02-17 18:16
  • 签到天数: 14 天

    [LV.3]偶尔看看II

    546

    主题

    715

    帖子

    1万

    积分

    管理员

    这里没有广告...

    Rank: 9Rank: 9Rank: 9

    积分
    10689
    QQ
    跳转到指定楼层
    楼主
    发表于 2015-08-18 11:26:54 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    MongoDB.Driver.MongoConnectionException: Unable to connect to the primary member of the replica set: Too many threads are already waiting for a connection..


    C# Driver:1.3.1

    Replset:
    localhost:10001 (primary)
    localhost:10002 (member)

    I have initReplset and add localhost:10002 to the replset,
    Then I create a new connection.When I try to connect,the exception happened.

    If slaveOk of this connection setting is true.

    Stack:
    MongoDB.Driver.MongoConnectionException: Unable to connect to any slaveOk
    member of the replica set: Too many threads are already waiting for a
    connection.. ---> MongoDB.Driver.MongoConnectionException: Too many threads
    are already waiting for a connection.
    at
    MongoDB.Driver.Internal.MongoConnectionPool.AcquireConnection(MongoDatabase
    database)
    at MongoDB.Driver.MongoServerInstance.Connect(Boolean slaveOk)
    at MongoDB.Driver.Internal.ReplicaSetConnector.ConnectWorkItem(Object
    argsObject)
    --- End of inner exception stack trace ---
    at MongoDB.Driver.Internal.ReplicaSetConnector.Connect(TimeSpan timeout,
    ConnectWaitFor waitFor)
    at MongoDB.Driver.MongoServer.Connect(TimeSpan timeout, ConnectWaitFor
    waitFor)
    at MongoDB.Driver.MongoServer.Connect(TimeSpan timeout)
    at MongoDB.Driver.MongoServer.Connect()
    at
    MagicMongoDBTool.Module.MongoDBHelper.FillConnectionToTreeView(TreeView
    trvMongoDB) in C:\Work
    Shop\MagicMongoDBTool\MagicMongoDBTool\Module\MongoDBHelper\MongoDBHelper_Connection_Present.cs:line
    63

    If I modify the SlaveOK to false:

    MongoDB.Driver.MongoConnectionException: Unable to connect to the primary
    member of the replica set: Too many threads are already waiting for a
    connection.. ---> MongoDB.Driver.MongoConnectionException: Too many threads
    are already waiting for a connection.
    at
    MongoDB.Driver.Internal.MongoConnectionPool.AcquireConnection(MongoDatabase
    database)
    at MongoDB.Driver.MongoServerInstance.Connect(Boolean slaveOk)
    at MongoDB.Driver.Internal.ReplicaSetConnector.ConnectWorkItem(Object
    argsObject)
    --- End of inner exception stack trace ---
    at MongoDB.Driver.Internal.ReplicaSetConnector.Connect(TimeSpan timeout,
    ConnectWaitFor waitFor)
    at MongoDB.Driver.MongoServer.Connect(TimeSpan timeout, ConnectWaitFor
    waitFor)
    at MongoDB.Driver.MongoServer.Connect(TimeSpan timeout)
    at MongoDB.Driver.MongoServer.Connect()
    at
    MagicMongoDBTool.Module.MongoDBHelper.FillConnectionToTreeView(TreeView
    trvMongoDB) in C:\Work
    Shop\MagicMongoDBTool\MagicMongoDBTool\Module\MongoDBHelper\MongoDBHelper_Connection_Present.cs:line
    63

    But there is not any application access to the server.





    OK,WaitQueueSize is need.


    清泛网 - 专注IT技能提升
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    © 2024 tsingfun.com, Inc.  沪ICP备2020034476号-1  沪公网安备31011702000040号

    GMT+8, 2024-05-21 11:32 , Processed in 0.022475 second(s), 36 queries .