javascript - Mongodb绑定多个ip
问题描述
我正在为 ubuntu 使用 mongodb v4.2.3,我正在尝试绑定 localhost 和我的公共 ip,但是每次我在编辑配置文件后重新加载 mongodb 时都会出错。
bind_ip = 127.0.0.1
port = 27017
重新启动mongodb时的错误:
Job for mongodb.service failed because the control process exited with error code.
See "systemctl status mongodb.service" and "journalctl -xe" for details.
解决方案
解决了。
bind_ip = 127.0.0.1
对于单个ip,因为它被解释为数字
bind_ip = "127.0.0.1,xxx.xxx.xxx.xxx"
对于多个ip,因为它被解释为字符串
推荐阅读
- angular - 角度 2+,垫表 - 过滤不适用于模型中的模型
- reactjs - 开玩笑 toMatchInlineSnapshot 一直显示“不允许操作,scandir 消息”
- javascript - AgGrid 自定义标题过滤器未显示
- c++ - 为什么我的 elseif 语句永远不会执行
- java - 为什么读取文件名中带有“:”的测试资源会导致 NPE?
- javascript - 拒绝加载脚本“https://apis.google.com/js/api.js”,因为它违反了以下内容安全策略指令
- reactjs - 更新道具不会调用 componentWillReceiveProps 方法
- c# - 在对 Post 方法的第二次调用中获得“异步模块或处理程序已完成,而异步操作仍处于挂起状态”
- php - 如何将 php 中的长数字(字符串)转换为 32 字节缓冲区?
- error-handling - 由于 DUPLICATES_DETECTED 错误,即使在重复规则中使用允许设置,也无法更新 Salesforce 帐户