【发布时间】:2015-05-22 00:46:41
【问题描述】:
我使用默认参数在 Google Cloud 上创建了一个准备就绪的 MongoDB 服务器。他们之间一切正常(有通信,我可以添加数据库和集合)。但是,我无法在任何外部机器上连接到 MongoDB。 我在 GCP 中创建了防火墙规则,允许端口 27017 上的所有连接(“0.0.0.0./0”)。
我正在运行命令:
giuseppe@ubuntu:~$ mongo --host rs0/104.154.xx.xxx,173.255.xxx.xxx,104.197.xxx.xxx
giuseppe@ubuntu:~$ mongo --host rs0/104.154.xxx.xxx:27017,173.255.xxx.xxx:27017,104.197.xxx.xxx:27017
我在他们两个上都遇到了同样的错误。我不知道如何解决这个问题。
connecting to: rs0/104.154.41.xxx,173.255.xxx.xxx,104.197.22.xxx:27017/test
2015-03-18T19:47:33.770-0500 starting new replica set monitor for replica set rs0 with seeds 104.154.41.xxx:27017,104.197.22.1xx:27017,xx.255.114.xxx:27017
2015-03-18T19:47:33.770-0500 [ReplicaSetMonitorWatcher] starting
2015-03-18T19:47:34.119-0500 changing hosts to rs0/mongo-db-jff3:27017,mongo-db-vnc4:27017 from rs0/104.154.41.246:27017,1xx.197.22.xxx:27017,173.255.1xx.xx:27017
2015-03-18T19:47:34.493-0500 getaddrinfo("mongo-db-vnc4") failed: Name or service not known
2015-03-18T19:47:34.511-0500 getaddrinfo("mongo-db-jff3") failed: Name or service not known
2015-03-18T19:47:34.512-0500 Error: connect failed to replica set rs0/104.154.xxx.xxx:27017,173.2xx.xxx.68:27017,104.197.22.xxx:27017 at src/mongo/shell/mongo.js:148
编辑:
这是我的防火墙设置。
【问题讨论】:
-
这与 google-app-engine 有什么关系(如果有)? 为什么人们会以这种方式标记这么多 Q,这显然是 不是 GAE 问题,但与 GCP 中的许多产品中的其他产品有关,例如(我怀疑这里)google -计算引擎?当您错误地标记这样的问题时,您是否意识到您让我们为您提供免费支持变得多么困难?!
-
我对 GCP 也有同样的问题,我使用端口 27017 设置了一个新的防火墙规则,IP 范围为 0.0.0.0/0,然后我在我的 vm 实例中添加了目标标签。我可以使用 SSH 连接和查看 instace 内的其他 mongo 实例(成员),一切正常,但在外部我无法连接“mongodb://user:pass@ip-1:27017,ip-2:27017,ip -3:27017/admin?replicaSet=rs-0" 只有我删除副本集时才能连接,"mongodb://user:pass@ip-1:27017,ip-2:27017,ip-3:27017/管理员”,我不知道为什么...
-
与community.bitnami.com/t/…中描述的错误相同
标签: mongodb google-compute-engine google-cloud-platform