如何通过VPN正确连接到远程MongoDB

时间:2019-09-16 12:34:25

标签: mongodb vpn

当尝试连接到只能通过vpn客户端访问的数据库时(例如FortiClient),我收到此错误:

"message" : "failed to connect to server [dbIp:27017] on first connect [MongoNetworkError: getaddrinfo ENOTFOUND dbIp dbIp:27017]",
    "stack" : "MongoNetworkError: failed to connect to server [dbIp:27017] on first connect [MongoNetworkError: getaddrinfo ENOTFOUND db-mongo-dev-adv.agiplan.aws.local dbIp:27017]" +
              "at Pool.<anonymous> (/tmp/.mount_nosqlbfiF4dW/resources/app.asar/node_modules/mongodb-core/lib/topologies/server.js:431:11)" +
              "at Pool.emit (events.js:182:13)" +
              "at connect (/tmp/.mount_nosqlbfiF4dW/resources/app.asar/node_modules/mongodb-core/lib/connection/pool.js:557:14)" +
              "at makeConnection (/tmp/.mount_nosqlbfiF4dW/resources/app.asar/node_modules/mongodb-core/lib/connection/connect.js:39:11)" +
              "at callback (/tmp/.mount_nosqlbfiF4dW/resources/app.asar/node_modules/mongodb-core/lib/connection/connect.js:261:5)" +
              "at Socket.err (/tmp/.mount_nosqlbfiF4dW/resources/app.asar/node_modules/mongodb-core/lib/connection/connect.js:286:7)" +
              "at Object.onceWrapper (events.js:273:13)" +
              "at Socket.emit (events.js:182:13)" +
              "at emitErrorNT (internal/streams/destroy.js:82:8)" +
              "at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)" +
              "at process._tickCallback (internal/process/next_tick.js:63:19)",
    "name" : "MongoNetworkError",
    "errorLabels" : [
        "TransientTransactionError"
    ]

我该如何解决?

0 个答案:

没有答案