无法从 Robo 3T 连接到 MongoDB Atlas

Trouble connecting to MongoDB Atlas from Robo 3T

我已经创建了一个免费的 Atlas 帐户并设置了一个集群。我正在尝试从 Robo 3T GUI 连接到 atlas 集群。我做了如下配置,

在连接选项卡中,我指定了类型设置为 Replica Set 的所有集群节点

在“身份验证”选项卡中,我提供了管理员用户的凭据。

未检查 SSH

TLS 设置为与自签名证书一起使用。

“高级”选项卡中未进行任何更改。

但是当我尝试连接时,连接失败并出现以下错误,

6:03:06 PM  Info: Settings saved to: /Users/sandeshaj/.3T/robo-3t/1.4.1/robo3t.json
6:03:06 PM  Info: Connecting to digify [Replica Set]cluster0-shard-00-02.hfjr8.mongodb.net:27017...
6:03:06 PM  Info: Settings saved to: /Users/sandeshaj/.3T/robo-3t/1.4.1/robo3t.json
6:03:24 PM  Info: Settings saved to: /Users/sandeshaj/.3T/robo-3t/1.4.1/robo3t.json
6:03:24 PM  Info: Replica set's cached set name cleared. Using user entered set name.
6:06:14 PM  Error: Establish connection failed. TLS tunnel failure: Network is unreachable or TLS connection rejected by server. Reason: Connect failed. Connection: digify
6:06:14 PM  Warning: Failed to ping the server. Could not find host matching read preference { mode: "primary", tags: [ {} ] } for set cluster0-shard-00-00

在 Atlas 帐户中,我已授予访问所有 IP 的权限,

我还应该如何从 Robo3T GUI 连接到 Atlas DB。

PS:我什至尝试取消选中 TLS。此外,尝试按照我为应用程序所做的设置中的建议将设置名称命名为 cluster0-shard-0 https://github.com/digifi-io/loan-origination-system

提前致谢。

试试这些:

  1. 转到 Atlas > 集群
  2. 点击“连接”按钮
  3. 使用 Mongo 罗盘
  4. 连接
  5. 您将看到 mongodb+srv://... 连接字符串。
  6. Copy/Past 你的 Robo3T 来自 Srv

也可以试试MongoDB Compass,比Robo3T还强大的工具

实际上,Atlas 中的副本集名称与我输入的不同 Robo 3T。当我在 shell 上执行 db.runCommand( { isMaster: 1 } ) 时,它给出了以下输出,

{
    "hosts" : [
        "cluster0-shard-00-00.hfjr8.mongodb.net:27017",
        "cluster0-shard-00-01.hfjr8.mongodb.net:27017",
        "cluster0-shard-00-02.hfjr8.mongodb.net:27017"
    ],
    "setName" : "atlas-n8lsue-shard-0",
    "setVersion" : 2,
    "ismaster" : true,
    "secondary" : false,
    "primary" : "cluster0-shard-00-02.hfjr8.mongodb.net:27017",
    "tags" : {
        "provider" : "AWS",
        "nodeType" : "ELECTABLE",
        "workloadType" : "OPERATIONAL",
        "region" : "US_EAST_1"
    },
    "me" : "cluster0-shard-00-02.hfjr8.mongodb.net:27017",
    "electionId" : ObjectId("7fffffff0000000000000006"),
    "lastWrite" : {
        "opTime" : {
            "ts" : Timestamp(1603813903, 3),
            "t" : NumberLong(6)
        },
        "lastWriteDate" : ISODate("2020-10-27T15:51:43Z"),
        "majorityOpTime" : {
            "ts" : Timestamp(1603813903, 3),
            "t" : NumberLong(6)
        },
        "majorityWriteDate" : ISODate("2020-10-27T15:51:43Z")
    },
    "maxBsonObjectSize" : 16777216,
    "maxMessageSizeBytes" : 48000000,
    "maxWriteBatchSize" : 100000,
    "localTime" : ISODate("2020-10-27T15:51:47.854Z"),
    "logicalSessionTimeoutMinutes" : 30,
    "connectionId" : 643442,
    "minWireVersion" : 0,
    "maxWireVersion" : 8,
    "readOnly" : false,
    "ok" : 1,
    "$clusterTime" : {
        "clusterTime" : Timestamp(1603813903, 3),
        "signature" : {
            "hash" : BinData(0,"ZQK/mzsowFmDfsrDc4kfXBAXIl4="),
            "keyId" : NumberLong("6875773608992440322")
        }
    },
    "operationTime" : Timestamp(1603813903, 3)
}

所以我将设置名称从Cluster-shard-0更改为atlas-n8lsue-shard-0,现在连接成功了