mongodb - 在 mongoDb 4.xx 中绑定多个 IP
问题描述
对于 mongoDB 4.0.3,无法在 bindIp 中添加多个 ip
以下配置适用于本地主机
net:
port:27017
bindIp:127.0.0.1
以下适用于从其他 ip 登录:
net:
port:27017
bindIp:0.0.0.0
以下不起作用
bindIp:127.0.0.1 10.0.0.10
bindIp:127.0.0.1,10.0.0.10
bindIp:"127.0.0.1,10.0.0.10"
bindIp:"127.0.0.1 10.0.0.10"
bindIp:[127.0.0.1,10.0.0.10]
bindIp:[127.0.0.1, 10.0.0.10]
0.0.0.0 或 127.0.0.1 以外的任何 ip 都会导致 bindIP 出错
如果我尝试以下:
bindIp:10.0.0.10
ERROR: child process failed, exited with error number 48
这个MongoDB Doc没有帮助
任何帮助将不胜感激。
解决方案
利用 ; 我在 Mongo 4.2.2 版本中使用
net:
port: 27017
bindIp: 127.0.0.1;10.0.1.149
推荐阅读
- api - 错误异常数组到字符串的转换
- json - axios POST 方法似乎被动态“转换”为 OPTIONS 方法
- javascript - 反应外部脚本控制台日志未显示
- c# - 是否可以在 .NET Core 上的 C# HttpClient 中修改 TLS 握手
- python - 所有站点的没有子网的 IP 正则表达式
- javascript - 错误:创建 React Native 项目版本 0.59.9 时找不到 template.config.js
- numpy - AttributeError:“numpy.ndarray”对象没有属性“_iter_test_masks”
- java - 在 ArrayList 中查找对象
- node.js - 如何保护我的 IPN 免受 bieng 欺骗或保护?
- buildship - connection.project.dir 的值是如何确定的?