我已经创建了一个准备就绪,谷歌云上的mongodb服务器使用它的默认参数。他们之间的一切工作正常(他们之间有通信,我可以添加数据库和集合),但是我无法连接到任何外部机器上的mongodb。
我在谷歌云平台上创建了防火墙规则,允许端口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他们两人都有同样的错误。我不知道该怎么做来解决这个问题。
连接到:rs0 /104.154.41.xxx,173.255.xxx.xxx,104.197.22.xxx:27017/test2015-03-18T19:47:33.770-0500启动新的副本集监视器副本集rs0与种子104.154.41.xxx:27017 ,104.197.22.1xx:27017,xx.255.114.xxx:270172015-03-18T19:47:33.770-0500 [ReplicaSetMonitorWatcher] starting2015-03-18T19:47:34.119-0500将主机更改为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:270172015-03-18T19:47:34.493-0500 getaddrinfo(mongo-db- vnc4)失败:名称或服务未知2015-03-18T19:47:34.511-0500 getaddrinfo(mongo-db-jff3)失败:名称或服务未知2015-03-18T19:47:34.512-0500错误:连接未能复制设置rs0 / 104.154.xxx.xxx:27017,173.2xx.xxx.68:27017,104 .197.22.xxx:27017 at src / mongo / shell / mongo.js:148
编辑:
这是我的防火墙设置:
解决方案你有没有
- 在Google云端控制台中配置防火墙规则
- 在您的防火墙规则中提供一个标签
- 用与防火墙规则相同的标记标记您的实例
?
我解释了如何详细打开一个端口到外部世界在这里。用您自己的端口号替换。
I've created a Ready to go , mongodb server on google cloud using the default parameters on it. Everything is working fine between them(there is comunication between them and i can add dbs and collections) , however i cant connect to mongodb on any external machine.
I've created the firewall rules in the google cloud platform allowing all the conections ("0.0.0.0./0") on the port 27017
I am running the comand
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:27017Im having the same error on both of them. I dont know what to do to solve this issue.
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
Edit :
This is my firewall settings :
解决方案Did you
- configure the firewall rule in Google cloud console
- provide a tag in your firewall rule
- tag your instance with the same tag as the firewall rule
?
I explained how to open a port to the outside world in detail over here. Replace with your own port number.
更多推荐
Google Cloud Mongo DB外部IP未连接
发布评论