I am trying to connect to a MongoDB instance running on a remote Linux server. The connection attempt is timing out leading me to suspect network settings on the Linux server as I can ssh to the server and connect to MongoDB locally.
/etc/mongod.conf does not have the bind_ip set, so that is not the issue.
Can anyone point me to how I can troubleshoot this problem?
Can you telnet to the MongoDB port from the remote host and connect successfully?
If so, that means the port is open, the connection works and it’s not a firewall/iptables etc. issue. You should look into the next piece – do you have authentication enabled?
If you can’t connect with telnet, then something is blocking you from getting from the remote host to that port. It could be firewall, or it could be on the host – it really depends on your set up and infrastructure.