且构网

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

连接被拒绝到 MongoDB errno 111

更新时间:2022-05-15 08:28:29

感谢大家的帮助!

原来是iptable冲突.列出端口打开的两个规则(导致端口关闭).

Turns out that it was an iptable conflict. Two rules listing the port open (which resulted in a closed port).

然而,aka 的一个评论和 manu2013 的另一个评论是我会遇到的问题,如果不是因为冲突.

However, one of the comments by aka and another by manu2013 were problems that I would have run into, if not for the conflict.

所以!永远记住编辑 /etc/mongod.conf 文件并设置你的 bind_ip = 0.0.0.0 以便在外部建立连接.

So! Always remember to edit the /etc/mongod.conf file and set your bind_ip = 0.0.0.0 in order to make connections externally.

此外,请确保您的 iptable 中没有与 mongo 想要的端口冲突的规则(请参阅 mongodb 网站上的链接 以正确设置您的 iptables.

Also, make sure that you don't have conflicting rules in your iptable for the port mongo wants (see link on mongodb's site to set up your iptables properly).