You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

已将IP加入白名单仍无法连接MongoDB Atlas的问题求助

MongooseServerSelectionError 无法连接MongoDB Atlas集群

我遇到了MongooseServerSelectionError:无法连接MongoDB Atlas集群中的任何服务器。提示的常见原因是访问数据库的IP未加入白名单,我已通过公网IP查询工具获取自己的公网IP并将其加入Atlas集群的IP白名单,但运行服务器时仍出现以下错误:

at _handleConnectionErrors (C:\Users\Gigabyte\Desktop\3rdYear2ndSem\SoftEng\BatstateU-tenants\node_modules\mongoose\lib\connection.js:755:11)
at NativeConnection.openUri (C:\Users\Gigabyte\Desktop\3rdYear2ndSem\SoftEng\BatstateU-tenants\node_modules\mongoose\lib\connection.js:730:11)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
{
  reason: TopologyDescription {
    type: 'ReplicaSetNoPrimary',
servers: Map(3) {
      'ac-btvwsde-shard-00-00.vktogmw.mongodb.net:27017' => [ServerDescription],
      'ac-btvwsde-shard-00-01.vktogmw.mongodb.net:27017' => [ServerDescription],
      'ac-btvwsde-shard-00-02.vktogmw.mongodb.net:27017' => [ServerDescription]
    },
    stale: false,
    compatible: true,
    heartbeatFrequencyMS: 10000,
    localThresholdMS: 15,
    setName: 'atlas-ze47mp-shard-0',
    maxElectionId: null,
    maxSetVersion: null,
    commonWireVersion: 0,
    logicalSessionTimeoutMinutes: null
  },
  code: undefined
}

内容的提问来源于stack exchange,提问作者Karl Aguilar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.28 23:45:09