Answers for "com.mongodb.mongosocketopenexception: exception opening socket"

0

com.mongodb.mongosocketopenexception: exception opening socket

By default MongoDB only binds to the loopback interface which makes it only accessible from localhost. To change that you need to edit this line in mongod.conf file;

# /etc/mongod.conf

# Listen to local interface only. Comment out to listen on all interfaces.
bind_ip = 127.0.0.1
you can change it to bind_ip = 127.0.0.1,192.168.1.102 to allow LAN and local connections or you can remove or comment out that line to allow all connections.
Posted by: Guest on March-08-2021

Browse Popular Code Answers by Language