Thursday, January 2, 2020

Unable to connect to mongo on remote server

make sure that mongodb daemon is running, and listening on 0.0.0.0, but not 127.0.0.1 port
for example, for my local mongodb, it has this config:
[vodolaz095@steel ~]$ cat /etc/mongod.conf 
##
### Basic Defaults
##

# Comma separated list of ip addresses to listen on (all local ips by default)
bind_ip = 127.0.0.1

# Specify port number (27017 by default)
#port = 27017
for mongodb server to listen for remote connections, you can change
# Comma separated list of ip addresses to listen on (all local ips by default)
bind_ip = 0.0.0.0

No comments:

Post a Comment