I am trying to initiate 3 node replica set, but it is failing with below error. Can anyone please suggest.
“ok” : 0,
"errmsg" : "replSetInitiate quorum check failed because not all proposed set members responded affirmatively: poc-mongo-02:27017 failed with Error connecting to poc-mongo-02:27017 :: caused by :: Could not find address for poc-mongo-02:27017: SocketException: Host not found (authoritative), poc-mongo-03:27017 failed with Error connecting to poc-mongo-03:27017 :: caused by :: Could not find address for poc-mongo-03:27017: SocketException: Host not found (authoritative)",*
Along with pinging can they communicate via the MongoDB port? You can do telnet to check if the FW is open. You need to make sure all hosts can communicate via the MongoDB port to all the other hosts.
We got the host names and IP’s added to the /etc/hosts on each node. After reattempt of the rs.initiate. Now it is giving different error.
Earlier it was “Could not find address for – SocketException: Host not found (authoritative)” & Now it is “failed with Error connecting to – :: caused by :: No route to host”"
“ok” : 0,
"errmsg" : "replSetInitiate quorum check failed because not all proposed set members responded affirmatively: poc-mongo-03:27017 failed with Error connecting to poc-mongo-03:27017 (xxx.xx.xxx.xx:27017) :: caused by :: No route to host, poc-mongo-02:27017 failed with Error connecting to poc-mongo-02:27017 (xxx.xx.xxx.xx:27017) :: caused by :: No route to host",*
using the host names you use in your replica set configuration. Make sure you ping all hosts from all hosts, even same host to same host and from the client you try to connect.
Ping was working on all the hosts from all the hosts. But the bidirectional communication between the hosts was failing. The mongo basic connectivity check was failing with the same error from one host to other host, error - "No route to host”. After investigation it has been identified that the port 27017 is behind the firewall. A new rule was added to allow the ports to open. Now the rsinitiate is completed and replicaset was configured successfully. Thank you all for the help.