MongoDB Atlas集群连接问题,身份验证错误。

5

我无法连接到我创建的mongoDB Atlas集群。在创建集群后,我输入了给定的代码行并收到了以下错误:

我找不到任何解决这个问题的方法。请帮帮我。

MongoDB shell version v4.2.0
Enter password: Cannot get console mode 6
connecting to: mongodb://cluster0-shard-00-01-jigfx.mongodb.net:27017,cluster0-shard-00-02-jigfx.mongodb.net:27017,cluster0-shard-00-00-jigfx.mongodb.net:27017/test?authSource=admin&compressors=disabled&gssapiServiceName=mongodb&replicaSet=Cluster0-shard-0&ssl=true
2019-09-03T17:07:19.299-0400 I  NETWORK  [js] Starting new replica set monitor for Cluster0-shard-0/cluster0-shard-00-01-jigfx.mongodb.net:27017,cluster0-shard-00-02-jigfx.mongodb.net:27017,cluster0-shard-00-00-jigfx.mongodb.net:27017
2019-09-03T17:07:19.300-0400 I  CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-01-jigfx.mongodb.net:27017
2019-09-03T17:07:19.300-0400 I  CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-02-jigfx.mongodb.net:27017
2019-09-03T17:07:19.300-0400 I  CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-00-jigfx.mongodb.net:27017
2019-09-03T17:07:20.099-0400 I  NETWORK  [ReplicaSetMonitor-TaskExecutor] 
Confirmed replica set for Cluster0-shard-0 is Cluster0-shard-0/cluster0-shard-00-00-jigfx.mongodb.net:27017,cluster0-shard-00-01-jigfx.mongodb.net:27017,cluster0-shard-00-02-jigfx.mongodb.net:27017
2019-09-03T17:07:20.719-0400 I  NETWORK  [js] Marking host cluster0-shard-00-00-jigfx.mongodb.net:27017 as failed :: caused by :: Location40659:can't connect to new replica set master [cluster0-shard-00-00-jigfx.mongodb.net:27017], err: AuthenticationFailed: Missing expected field "pwd"


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


2019-09-03T17:07:21.522-0400 E  QUERY    [js] Error: Missing expected field "pwd" :
connect@src/mongo/shell/mongo.js:341:17
@(connect):2:6
2019-09-03T17:07:21.524-0400 F  -        [main] exception: connect failed
2019-09-03T17:07:21.524-0400 E  -        [main] exiting with code 1

预期结果是一个提示框,要求输入连接到群集的密码,但是提示框立即回复“无法获取控制台模式6”。

你是否已经添加了IP白名单条目?你是否使用连接对话框中提供的shell命令? - It'sNotMe
你找到解决方案了吗?我也卡在同样的问题上了。 - Rahul Dapke
请查看此链接以获取答案。 https://dev59.com/Drfna4cB1Zd3GeqP1_aQ#59910899 - Yonatan Dawit
1个回答

5
尝试在命令末尾添加--password ****

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接