How to connect to MongoDB EC2 instance

前端 未结 6 768
失恋的感觉
失恋的感觉 2020-12-31 02:05

we have an EC2 MongoDB 2.4 instance from Amazon MarketPlace. when i try to access it from my computer using the mongo command like so:

mongo xx-xx-xx-xx-xx.c         


        
6条回答
  •  遥遥无期
    2020-12-31 02:30

    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)

    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.

提交回复
热议问题