【问题标题】:How to fix connection problems when nothing seems to work当似乎没有任何工作时如何解决连接问题
【发布时间】:2019-07-09 11:08:38
【问题描述】:

我正在尝试从 windows 终端中的 mongoshell 连接到我的 atlas 集群。连接字符串正确写入,我确保集群版本 (4.0.10) 和 shell 版本 (4.0.10) 相同。我还确保我的 IP 地址被列入白名单,并且出于测试目的,我还添加了“0.0.0.0/0”。仍然无法连接。

我尝试过创建新数据库、更改用户、创建新用户、更改用户权限、更改 ip 白名单、使用不同的连接字符串、关闭 windows 防火墙,但仍然存在相同的错误。

MongoDB shell version v4.0.10
Enter password:
connecting to: mongodb://charmsdb-shard-00-02-5s81x.mongodb.net.:27017,charmsdb-shard-00-01-5s81x.mongodb.net.:27017,charmsdb-shard-00-00-5s81x.mongodb.net.:27017/test?authSource=admin&gssapiServiceName=mongodb&replicaSet=CharmsDB-shard-0&ssl=true
2019-07-09T12:42:04.136+0200 I NETWORK  [js] Starting new replica set monitor for CharmsDB-shard-0/charmsdb-shard-00-02-5s81x.mongodb.net.:27017,charmsdb-shard-00-01-5s81x.mongodb.net.:27017,charmsdb-shard-00-00-5s81x.mongodb.net.:27017
2019-07-09T12:42:04.256+0200 W NETWORK  [js] Unable to reach primary for set CharmsDB-shard-0
2019-07-09T12:42:04.256+0200 I NETWORK  [js] Cannot reach any nodes for set CharmsDB-shard-0. Please check network connectivity and the status of the set. This has happened for 1 checks in a row.

我希望建立一个网络连接,但它不允许我连接到任何网络。

【问题讨论】:

标签: mongodb mongo-shell mongodb-atlas


【解决方案1】:

问题可能出在 Window 的防火墙中。 MongoDB 使用端口 nr。 27017 为了使它工作,它必须打开。

此外,如果您使用 Atlas,您可以通过他们的连接字符串进行连接。 https://www.mongodb.com/

【讨论】:

    猜你喜欢
    • 2021-04-03
    • 2012-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多