我按照下面的说明设置了VPC:http://docs.amazonwebservices.com/AmazonVPC/latest/UserGuide/VPC_Scenario2.html
我在私有子网中有一个盒子,我想将其用作mongo盒子。内网IP为10.0.1.51。
我可以通过localhost连接mongod实例,但不能通过内网IP连接:
ubuntu@ip-10-0-1-51:~$ mongo localhost
connecting to: localhost
> this works
> ^Cubuntu@ip-10-0-1-51:~$ mongo 10.0.1.51
Fri Sep 21 02:23:18 Error: couldn't connect to server 10.0.1.51 shell/mongo.js:81
exception: connect failed
ubuntu@ip-10-0-1-51:~$ 安全组允许传入和传出端口27017。
路由表具有
10.0.0.0/16 local 进入。
我遗漏了什么?
发布于 2013-01-30 04:23:10
问题实际上出在mongodb配置中,而不是路由表。与MySQL一样,MongoDB需要允许来自特定主机的连接。
在mongodb.conf中:
bind_ip = <%= @bind_ip || '127.0.0.1' %>
port = <%= @port || '27017' %>其中,@bind_ip和@port是显示给客户端节点的服务器的IP和端口。
发布于 2013-01-26 12:55:23
有三件事会影响Amazon VPC上的网络连接。
我猜这是你的ACL,因为你在最初的帖子中没有提到它们。
https://stackoverflow.com/questions/12523460
复制相似问题