简体   繁体   English

错误:无法连接到新的副本集主服务器

[英]Error: can't connect to new replica set master

I have been trying to connect my node js application to mongo db atlas but i keep getting this error我一直在尝试将我的节点 js 应用程序连接到 mongo db atlas 但我一直收到此错误

`MongoDB shell version v4.2.5
connecting to: mongodb://cluster0-shard-00-02-kmhdr.mongodb.net:27017,cluster0-shard-00-00-kmhdr.mongodb.net:27017,cluster0-shard-00-01-kmhdr.mongodb.net:27017/test?authSource=admin&compressors=disabled&gssapiServiceName=mongodb&replicaSet=Cluster0-shard-0&ssl=true
2020-04-12T18:35:54.356-0700 I  NETWORK  [js] Starting new replica set monitor for Cluster0-shard-0/cluster0-shard-00-02-kmhdr.mongodb.net:27017,cluster0-shard-00-00-kmhdr.mongodb.net:27017,cluster0-shard-00-01-kmhdr.mongodb.net:27017
2020-04-12T18:35:54.358-0700 I  CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-02-kmhdr.mongodb.net:27017
2020-04-12T18:35:54.359-0700 I  CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-01-kmhdr.mongodb.net:27017
2020-04-12T18:35:54.359-0700 I  CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-00-kmhdr.mongodb.net:27017
2020-04-12T18:35:56.232-0700 I  NETWORK  [ReplicaSetMonitor-TaskExecutor] Confirmed replica set for Cluster0-shard-0 is Cluster0-shard-0/cluster0-shard-00-00-kmhdr.mongodb.net:27017,cluster0-shard-00-01-kmhdr.mongodb.net:27017,cluster0-shard-00-02-kmhdr.mongodb.net:27017
2020-04-12T18:35:58.988-0700 I  NETWORK  [js] Marking host cluster0-shard-00-02-kmhdr.mongodb.net:27017 as failed :: caused by :: Location40659: can't connect to new replica set master [cluster0-shard-00-02-kmhdr.mongodb.net:27017], err: AuthenticationFailed: bad auth Authentication failed.


*** It looks like this is a MongoDB Atlas cluster. Please ensure that your IP whitelist allows connections from your network.


2020-04-12T18:35:58.991-0700 E  QUERY    [js] Error: can't connect to new replica set master [cluster0-shard-00-02-kmhdr.mongodb.net:27017], err: AuthenticationFailed: bad auth Authentication failed. :
connect@src/mongo/shell/mongo.js:341:17
@(connect):2:6
2020-04-12T18:35:59.025-0700 F  -        [main] exception: connect failed
2020-04-12T18:35:59.026-0700 E  -        [main] exiting with code 1

Please help me resolve this issue.请帮我解决这个问题。 Thanks谢谢

I had similar issue.我有类似的问题。

That's how i solved this.我就是这样解决这个问题的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 MongoDB:无法连接到新的副本集主 - MongoDB: Can't connect to new replica set master 当选择新的主要数据库时,Express无法连接到mongodb副本集 - Express can't connect to mongodb replica set when new primary get elected 本地mongo停止时,Express无法连接到mongodb副本集 - Express can't connect to mongodb replica set when local mongo is stoped Mongo副本集找不到主副本 - Mongo replica set can't find primary 无法通过NodeJS连接到MongoDB-在副本集中找不到主数据库错误 - Cannot connect to MongoDB via NodeJS - No primary found in replica set error 副本集故障转移后,无法从Mongoose(MongoDB,NodeJS驱动程序)自动重新连接到New PRIMARY - Failing to automatically re-connect to New PRIMARY after a replica set failover , from Mongoose (MongoDB, NodeJS Driver) Redis sentinel not connect to master: Error: READONLY You can't write against a read only slave? - Redis sentinel not connect to master: Error: READONLY You can't write against a read only slave? 抛出新的错误('不能在发送后设置标题。'); - throw new Error('Can\'t set headers after they are sent.'); 如何使用SSL从节点js连接到mongodb副本集 - How to connect from node js to mongodb replica set using SSL windows 6.0以上新版本mongoDb如何创建副本集 - How to create replica set in mongoDb new version above 6.0 in windows
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM