且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何连接到MongoDB EC2实例

更新时间:2022-06-27 10:05:24

正如frisky所说,您必须在EC2安全组控制台上打开端口27017. (要了解有关如何执行此操作的更多信息:

As frisky said, you have to open the port 27017 at the EC2 Security Group Console. (To know more about how to do that: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/authorizing-access-to-an-instance.html)

但是您还需要在/etc/mongodb.conf文件中更改bind_ip变量.您需要注释该行或分配将数据库连接到它的IP.

But you also need to change the bind_ip variable at the /etc/mongodb.conf file. You need to comment the line or assign the ip that will be able to connect the DB to it.