【问题标题】:Connection to Mongodb Atlas cluster is closing unexpectedly与 Mongodb Atlas 集群的连接意外关闭
【发布时间】:2019-09-13 15:44:32
【问题描述】:

我收到 mongo 错误,即对于我发出的所有其他数据库请求,“与 MongoDB 的连接已关闭”,我查了一下,解决方案是 白名单 IP - 添加 0.0.0.0/0 到允许的 IP, 正确设置 URI, 检查连接 - 能够从 Studio 3t 应用程序连接,

错误日志说:

MongoError: connection 72 to cluster0-shard-00-01-****.mongodb.net:27017 closed
    at Function.MongoError.create (/**/node_modules/mongodb-core/lib/error.js:29:11)
    at TLSSocket.<anonymous> (/**/node_modules/mongodb-core/lib/connection/connection.js:214:22)
    at Object.onceWrapper (events.js:285:13)
    at TLSSocket.emit (events.js:202:15)
    at TLSSocket.EventEmitter.emit (domain.js:446:20)
    at _handle.close (net.js:611:12)
    at Socket.done (_tls_wrap.js:412:7)
    at Object.onceWrapper (events.js:285:13)
    at Socket.emit (events.js:197:13)
    at Socket.EventEmitter.emit (domain.js:446:20)
    at TCP._handle.close (net.js:611:12)

我已经尝试了一切都没有结果,如果有人可以帮助我确定要研究的方向或遇到并解决它的任何人可以指导我,将不胜感激。

【问题讨论】:

    标签: node.js mongodb mongoose mongodb-atlas


    【解决方案1】:

    转到您的集群网络访问并在 IP 白名单中再次添加您的 IP 地址。我正在使用 wi-fi,并且我的 id 会定期更改。

    【讨论】:

      猜你喜欢
      • 2021-03-09
      • 2018-03-05
      • 2022-06-13
      • 1970-01-01
      • 2019-06-10
      • 2020-01-15
      • 2017-12-12
      • 1970-01-01
      • 2021-04-29
      相关资源
      最近更新 更多