尽管绑定了 ip,但在本地网络中无法访问 MongoDB 服务器 [英] MongoDB server not accessible in local Network despite binding ip
问题描述
我在 macOS 上使用 MongoDB v3.6.3,通过 home-brew 安装.我已经使用了几乎所有可能的方法来使我的 MongoDB 服务器在本地网络上可访问,但无济于事.我有:
I am using MongoDB v3.6.3 on macOS, installed via home-brew. I have used almost every possible way to make my MongoDB server accessible on local network, but to no avail. I have:
- 关闭两台机器上的防火墙
- 编辑 \etc\mongod.conf 文件以添加 bindIP.
- used options-> bind_ip, bind_ip_all (127.0.0.1, 0.0.0.0, 其他机器的地址)
事实上,我的 redis-server 也无法在网络上访问.我相信这中间存在一个共同的问题.我已经在 macOS High Sierra、Ubuntu 16、Windows 10 上尝试了上述解决方案.
As a matter of fact, also, my redis-server is not accessible on network. I believe there is a common issue in between this. I have tried the above mentioned solutions on macOS High Sierra, Ubuntu 16, Windows 10.
推荐答案
我遇到了同样的错误.您可以在启动服务器时使用以下参数允许外部访问:
I have been facing the same error. You could allow external access using the following parameters when starting your server:
mongod --bind_ip_all // Allow any ip
或
mongod --bind_ip <your_ip_here>
这篇关于尽管绑定了 ip,但在本地网络中无法访问 MongoDB 服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!