且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Mongodb无法连接到本地主机,但可以连接到本地主机的IP地址

更新时间:2022-11-29 22:15:11

mongodb.conf(或启动脚本)中是否设置了bind_ip? 为清楚起见进行编辑设置将IP地址限制为仅侦听该IP地址.

Do you have a bind_ip set in your mongodb.conf (or startup script)? edit for clarity A bind_ip setting limits the IP it will listen on to that IP only.

请参阅"IP地址绑定"部分: http://www.mongodb.org /display/DOCS/Security + and + Authentication

See the IP Address Binding section: http://www.mongodb.org/display/DOCS/Security+and+Authentication

如果没有,您是否有任何防火墙规则阻止localhost访问?那有点奇怪,但是我想不出另一个原因,尽管LAN IP可以工作,但是它却无法工作.

If not, do you have any firewall rules blocking the localhost access? That would be kind of strange, but I can't think of another reason why it wouldn't work while the LAN IP would work.