How to allow all hosts to a replica set in mongodb

前端 未结 1 1451
时光说笑
时光说笑 2020-12-22 02:48

When I am connecting my replica set from local machine like this

\"mongodb://my_server_ip:27018/?readPreference=secondary&replicaSet=rs0&appname=Mon         


        
相关标签:
1条回答
  • 2020-12-22 03:21

    Replica set must be configured with host addresses that are accessible from both RS nodes and the clients.

    For an RS used over the network, this means public hostnames/IP addresses of the host nodes rather than loopback addresses.

    0 讨论(0)
提交回复
热议问题