📜  com.mongodb.mongosocketopenexception:异常打开套接字 - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:41.752000             🧑  作者: Mango

代码示例1
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.