且构网

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

与MongoDB errno 111的连接被拒绝

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

感谢大家的帮助!

结果证明这是一个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想要的端口冲突规则(请参阅

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).