gpt4 book ai didi

node.js - 尽管绑定(bind)了 ip,但在本地网络中无法访问 MongoDB 服务器

转载 作者:可可西里 更新时间:2023-11-01 11:24:44 25 4
gpt4 key购买 nike

我在 macOS 上使用 MongoDB v3.6.3,通过自制软件安装。我几乎使用了所有可能的方法使我的 MongoDB 服务器可以在本地网络上访问,但无济于事。我有:

  • 关闭两台机器上的防火墙
  • 编辑\etc\mongod.conf 文件以添加 bindIP。
  • 使用选项-> bind_ip, bind_ip_all (127.0.0.1, 0.0.0.0, 其他机器的地址)

事实上,我的redis-server也无法通过网络访问。我相信这之间存在一个共同的问题。我已经在 macOS High Sierra、Ubuntu 16、Windows 10 上尝试了上述解决方案。

最佳答案

我一直面临同样的错误。您可以在启动服务器时使用以下参数允许外部访问:

mongod --bind_ip_all // Allow any ip

mongod --bind_ip <your_ip_here>

关于node.js - 尽管绑定(bind)了 ip,但在本地网络中无法访问 MongoDB 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49580538/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com