提问人:chilly_maximus 提问时间:4/6/2021 最后编辑:Christian Fritzchilly_maximus 更新时间:4/6/2021 访问量:209
Mongo Atlas连接问题
mongo atlas connection troubles
问:
我有一个应用程序,在meteor.js中创建,但我认为它不应该重要。我在mongo atlas上也有mongo集群。到目前为止,在开发过程中,我通过连接字符串连接到数据库,没有问题地从我的本地机器。但是,当我在 DigitalOcean 上创建 linux 机器并尝试使用相同的连接字符串连接我的应用程序时mongodb+srv://<user>:<password>@xyz.mongodb.net/<dbName>?retryWrites=true&w=majority
我收到以下错误。
MongoNetworkError: failed to connect to server [xyz.mongodb.net:27017] on first connect [MongoNetworkError: connection 5 to xyz.mongodb.net:27017 closed
at TLSSocket.<anonymous> (/home/ubuntu/staging/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connection.js:440:9)
at Object.onceWrapper (events.js:421:26)
at TLSSocket.emit (events.js:314:20)
at TLSSocket.EventEmitter.emit (domain.js:483:12)
at net.js:675:12
at TCP.done (_tls_wrap.js:568:7)]
at Pool.<anonymous> (/home/ubuntu/staging/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/topologies/server.js:438:11)
at Pool.emit (events.js:314:20)
at Pool.EventEmitter.emit (domain.js:483:12)
at /home/ubuntu/staging/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/pool.js:562:14
at /home/ubuntu/staging/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/pool.js:1009:9
at callback (/home/ubuntu/staging/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connect.js:75:5)
at /home/ubuntu/staging/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connect.js:101:9
at _callback (/home/ubuntu/staging/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connection.js:329:7)
at Connection.errorHandler (/home/ubuntu/staging/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connection.js:344:7)
at Object.onceWrapper (events.js:421:26)
at Connection.emit (events.js:314:20)
at Connection.EventEmitter.emit (domain.js:483:12)
at TLSSocket.<anonymous> (/home/ubuntu/staging/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connection.js:438:12)
at Object.onceWrapper (events.js:421:26)
at TLSSocket.emit (events.js:314:20)
at TLSSocket.EventEmitter.emit (domain.js:483:12)
你知道我的服务器配置可能有什么问题吗?我想这是服务器配置,因为在其他机器上相同的连接字符串有效。
答: 暂无答案
上一个:如何挂接到节点http请求?
评论
network access
IP Whitelist
xyz.mongodb.net
telnet xyz.mongodb.net 27017