MongoDB:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
无编辑摘要
Kangkk​(留言 | 贡献)
无编辑摘要
第12行: 第12行:
   bindIp: 127.0.0.1  # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.
   bindIp: 127.0.0.1  # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.
...
...
</syntaxhighlight>|output2=<syntaxhighlight lang="bash">
</syntaxhighlight>|output2=<syntaxhighlight lang="bash" highlight="5">
...
...
# network interfaces
# network interfaces

2020年3月25日 (三) 10:24的版本

MongoDB

远程访问配置

修改mongodb的配置文件 让其监听所有外网 IP。

 
vi /etc/mongodb.conf
mongodb.conf
...
# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1  # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.
...
...
# network interfaces
net:
  port: 27017
  bindIp: 0.0.0.0  # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.
...
 
systemctl restart mongod.service