I have configured a mongodb on my server to accept remote connections.I commented the bind
line in the /etc/mongod.conf
, so the file looks like:
# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# Where and how to store data.
storage:
dbPath: /var/lib/mongodb
journal:
enabled: true
# engine:
# mmapv1:
# wiredTiger:
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
# network interfaces
net:
port: 27017
# bindIp: 127.0.0.1
#processManagement:
#security:
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options:
#auditLog:
#snmp:
I configured the server to accept connections on port 27017 and as you can see there's no other security measures like password.
When I try to connect to the server's port 27017, everything goes well, but after 2 or 3 minutes (4 or 5 queries to mongo server), the connection is suddenly lost and server is not reachable then.
Cannot connect to the MongoDB at ****:27017.
Error:
Network is unreachable.
Server is reachable and I can telnet other ports and make an ssh connection to server, but till I reset my OS, I can not reach the port 27017 again. The problem is only occurring on my OS and others don't have the problem, So it's probably my OS's problem. But I'm confused about it. What can be the problem?
verbosity: 5
but double-check and confirm.