【发布时间】:2020-07-15 09:19:47
【问题描述】:
我无法连接到我的 MongoDb 数据库。我检查了几次,我的 IP 地址在网络访问中正确列入白名单。我有以下信息:
message:
'Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that
you\'re trying to access the database from an IP that isn\'t whitelisted. Make sure your current IP address is on your Atlas cluster\'s IP whitelist: https://docs.atlas.mongodb.com/security-whitelist/',
reason:
TopologyDescription {
type: 'ReplicaSetNoPrimary',
setName: null,
maxSetVersion: null,
maxElectionId: null,
servers:
Map {
'cluster0-shard-00-01-216w6.mongodb.net:27017' => [ServerDescription],
'cluster0-shard-00-02-216w6.mongodb.net:27017' => [ServerDescription],
'cluster0-shard-00-00-216w6.mongodb.net:27017' => [ServerDescription] },
stale: false,
compatible: true,
compatibilityError: null,
logicalSessionTimeoutMinutes: null,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
commonWireVersion: null } }
^C
【问题讨论】:
-
能否请您说明您是如何将您的 IP 列入白名单的
-
确保您的 IP 已列入白名单。
-
我去了网络访问,我有我当前的 IP 地址,但那不起作用;
标签: node.js windows mongodb mongoose connection