I cannot connect remotely to a mongo server running on EC2, even though if I ssh into the server the mongo is running properly. Also note, that the 27017
port is open on both tcp and udp protocols. I am getting the following error:
MongoDB shell version: 2.4.8
connecting to: ec2-x...x-compute.amazonaws.com:27017/test
Thu Sep 4 13:26:04.293 Error: couldn't connect to server to: ec2-x...x-compute.amazonaws.com:27017/test at src/mongo/shell/mongo.js:147
exception: connect failed
I have Mongodb version 2.4.8
on my local host and on the server Mongodb version 2.6.4
. Could the version difference be a problem?
Are you binding to the external IP? Or just localhost:
http://docs.mongodb.org/manual/reference/configuration-options/
net:
bindIp: 127.0.0.1 # Should be 0.0.0.0 to listen on all interfaces
port: 27017
Also, I know you said that the port is open. Did you check this using nmap/netcat? You should check the AWS security group and the local firewall to make sure it's open.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With