Unable to connect to MongoDB Replica Set using public IP addresses

别说谁变了你拦得住时间么 提交于 2019-12-02 08:07:46

When you connect to the replica set, you should use the same addresses (ip addresses or host names) as the nodes use for each other in the replica set configuration. For replica set deployment, you need to:

Ensure that network traffic can pass between all members of the set and all clients in the network securely and efficiently.

In practice, it is best not to configure your replica set using public ip addresses; it is more secure to use the private ip addresses, which helps ensure that your database can only receive connections from authorised locations.

this might be one of the reason.

You should add all 3 servers public IP in to the bind ip values in all 3 servers /etc/mongod.conf

if your are using AWS, you need to allow all this IP for inbound access to another server.

Thanks guys for responses, It needed to configure replica with public Ips in rs.config

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!