thread while connecting to server localhost:27017 com.mongodb.MongoSocketOpenException: Exception opening socket code example
Example: 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.