无法从Virtualbox连接到MongoDB Atlas集群

时间:2019-07-18 16:36:11

标签: mongodb mongodb-atlas

我正在尝试从运行Windows10的Virtualbox连接到我的MongoDB Atlas集群。

  • 从运行Virtualbox本身的计算机进行连接可以正常工作。
  • 通常通过Virtualbox(浏览,投寄箱等)进行Internet连接
  • 我在两台计算机上都运行最新版本的Shell-v4.0.10。
  • 我已将0.0.0.0/0添加到白名单,作为对其进行故障排除的一种方法 (它会给出相同的错误)。
  • 我还已将shell可执行文件添加到防火墙例外中,并分别为端口27017打开了Virtualbox上的传入和传出流量。

以下是终端中打印出的内容:

Microsoft Windows [Version 10.0.17763.379]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Windows\system32>mongo "mongodb+srv://cluster0-cd8gj.mongodb.net/test" --username xxxx
MongoDB shell version v4.0.10
Enter password:
connecting to: mongodb://cluster0-shard-00-00-cd8gj.mongodb.net.:27017,cluster0-shard-00-01-cd8gj.mongodb.net.:27017,cluster0-shard-00-02-cd8gj.mongodb.net.:27017/test?authSource=admin&gssapiServiceName=mongodb&replicaSet=Cluster0-shard-0&ssl=true
2019-07-18T17:58:13.929+0200 I NETWORK  [js] Starting new replica set monitor for Cluster0-shard-0/cluster0-shard-00-00-cd8gj.mongodb.net.:27017,cluster0-shard-00-01-cd8gj.mongodb.net.:27017,cluster0-shard-00-02-cd8gj.mongodb.net.:27017
2019-07-18T17:58:14.767+0200 W NETWORK  [js] Unable to reach primary for set Cluster0-shard-0
2019-07-18T17:58:14.796+0200 I NETWORK  [js] 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.
2019-07-18T17:58:15.654+0200 W NETWORK  [js] Unable to reach primary for set Cluster0-shard-0
2019-07-18T17:58:15.654+0200 I NETWORK  [js] 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.
2019-07-18T17:58:16.509+0200 W NETWORK  [js] Unable to reach primary for set Cluster0-shard-0
2019-07-18T17:58:16.510+0200 I NETWORK  [js] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 3 checks in a row.
2019-07-18T17:58:17.400+0200 W NETWORK  [js] Unable to reach primary for set Cluster0-shard-0
2019-07-18T17:58:17.519+0200 I NETWORK  [js] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 4 checks in a row.
2019-07-18T17:58:18.605+0200 W NETWORK  [js] Unable to reach primary for set Cluster0-shard-0
2019-07-18T17:58:18.672+0200 I NETWORK  [js] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 5 checks in a row.
2019-07-18T17:58:19.654+0200 W NETWORK  [js] Unable to reach primary for set Cluster0-shard-0
2019-07-18T17:58:19.655+0200 I NETWORK  [js] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 6 checks in a row.
2019-07-18T17:58:20.513+0200 W NETWORK  [js] Unable to reach primary for set Cluster0-shard-0
2019-07-18T17:58:20.514+0200 I NETWORK  [js] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 7 checks in a row.
2019-07-18T17:58:21.445+0200 W NETWORK  [js] Unable to reach primary for set Cluster0-shard-0
2019-07-18T17:58:21.496+0200 I NETWORK  [js] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 8 checks in a row.
2019-07-18T17:58:22.575+0200 W NETWORK  [js] Unable to reach primary for set Cluster0-shard-0
2019-07-18T17:58:22.576+0200 I NETWORK  [js] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 9 checks in a row.
2019-07-18T17:58:23.448+0200 W NETWORK  [js] Unable to reach primary for set Cluster0-shard-0
2019-07-18T17:58:23.457+0200 I NETWORK  [js] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 10 checks in a row.
2019-07-18T17:58:24.332+0200 W NETWORK  [js] Unable to reach primary for set Cluster0-shard-0
2019-07-18T17:58:24.348+0200 I NETWORK  [js] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 11 checks in a row.
2019-07-18T17:58:25.281+0200 W NETWORK  [js] Unable to reach primary for set Cluster0-shard-0
2019-07-18T17:58:26.206+0200 W NETWORK  [js] Unable to reach primary for set Cluster0-shard-0
2019-07-18T17:58:27.062+0200 W NETWORK  [js] Unable to reach primary for set Cluster0-shard-0
2019-07-18T17:58:27.926+0200 W NETWORK  [js] Unable to reach primary for set Cluster0-shard-0
2019-07-18T17:58:28.790+0200 W NETWORK  [js] Unable to reach primary for set Cluster0-shard-0


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


2019-07-18T17:58:28.988+0200 E QUERY    [js] Error: connect failed to replica set Cluster0-shard-0/cluster0-shard-00-00-cd8gj.mongodb.net.:27017,cluster0-shard-00-01-cd8gj.mongodb.net.:27017,cluster0-shard-00-02-cd8gj.mongodb.net.:27017 :
connect@src/mongo/shell/mongo.js:344:17
@(connect):2:6
exception: connect failed

================================================ =

任何朝着正确方向的指针都将受到赞赏。

================================================ =

我还可以补充一点,我已经在正在运行的Virtualbox上设置了本地MongoDB。

0 个答案:

没有答案