无法通过mongo shell连接到mongodb地图集

问题描述 投票:7回答:3

我检查了其他类似的帖子,但没有一个适合我的情况。

我在连接到MongoDB Atlas之前就升级了我的mongo shell,我从中创建了一个免费的沙箱数据库。我使用以下内容进行连接,由atlas提供。

mongo "mongodb+srv://cluster0-z2lf6.mongodb.net/test" --authenticationDatabase admin --username <user> --password <password>

数据库用户的图像:

数据库概述的屏幕截图:

这些是数据库的细节:

但是,终端显示这个(我只包括大约15行,其余的是重复。):

MongoDB shell version v3.6.0
connecting to: mongodb+srv://cluster0-z2lf6.mongodb.net/test
2017-12-24T14:39:42.806+0800 I NETWORK  [thread1] Starting new replica set monitor for Cluster0-shard-0/cluster0-shard-00-00-z2lf6.mongodb.net.:27017,cluster0-shard-00-01-z2lf6.mongodb.net.:27017,cluster0-shard-00-02-z2lf6.mongodb.net.:27017
2017-12-24T14:39:42.990+0800 W NETWORK  [ReplicaSetMonitor-TaskExecutor-0] Failed to connect to 34.232.245.97:27017, in(checking socket for error after poll), reason: Connection refused
2017-12-24T14:39:42.991+0800 W NETWORK  [thread1] Failed to connect to 35.168.27.238:27017, in(checking socket for error after poll), reason: Connection refused
2017-12-24T14:39:43.492+0800 W NETWORK  [ReplicaSetMonitor-TaskExecutor-0] Failed to connect to 52.20.90.64:27017, in(checking socket for error after poll), reason: Connection refused
2017-12-24T14:39:43.492+0800 W NETWORK  [ReplicaSetMonitor-TaskExecutor-0] Unable to reach primary for set Cluster0-shard-0
2017-12-24T14:39:43.492+0800 I NETWORK  [ReplicaSetMonitor-TaskExecutor-0] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 1 checks in a row.
2017-12-24T14:39:43.997+0800 W NETWORK  [thread1] Failed to connect to 35.168.27.238:27017, in(checking socket for error after poll), reason: Connection refused
2017-12-24T14:39:44.000+0800 W NETWORK  [thread1] Failed to connect to 34.232.245.97:27017, in(checking socket for error after poll), reason: Connection refused
2017-12-24T14:39:44.003+0800 W NETWORK  [thread1] Failed to connect to 52.20.90.64:27017, in(checking socket for error after poll), reason: Connection refused
2017-12-24T14:39:44.004+0800 W NETWORK  [thread1] Unable to reach primary for set Cluster0-shard-0
2017-12-24T14:39:44.004+0800 I NETWORK  [thread1] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 2 checks in a row.

这种连接错误的原因是什么?

mongodb mongo-shell mongodb-atlas
3个回答
4
投票

在我的情况下,原因是提供商改变了我的IP地址(我有动态IP,在NAT后面)

在我更新ip白名单后,连接已恢复

enter image description here


4
投票

实际上我无法连接的原因是因为我的大学无线网络有网络限制。我从MongoDB的支持团队那里获得了测试网址http://portquiz.net:27017,我在浏览器中打开它并且无法访问它。我改变到另一个有wifi的地方,它工作。


-2
投票

我想我和你在同一个证书课上。我刚刚结束的证书日期是12月12日。

我看到你的其他帖子,人们降级但试图联系你。

我不在我的电脑附近,但我可以发给你我的证书(作为学生),看看你是否可以登录。在你的另一篇文章中,你问了一个关于数据模型的问题以及在哪里得到类似的东西。

在YouTube上,来自欧洲的一位绅士提供了一个很棒的mongodb教程。我是在大学之前做过的。你感兴趣吗?我能为你找到链接吗?这是相同的信息,但更好地解释。

它必须是明天(对我来说)。我在台湾。

© www.soinside.com 2019 - 2024. All rights reserved.