How to connect to MongoDB EC2 instance

前端 未结 6 765
失恋的感觉
失恋的感觉 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:22

    EC2 controls access using security group, so make sure that box accessing mongo db host is in the security group allowed to access this box and port is enabled for the same security group.

    Another problem can be iptables. Check sudo service iptables status on the mongodb box and see what are the rules there.

    Make sure there you enable appropriate ports as per security requirement of the box.

提交回复
热议问题