Rs.initiate is failing

Hi,

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)",*
    
  •    "code" : 74,*
    
  •    "codeName" : "NodeNotFound"*
    

Thanks & Regards,
Pradeep Kumar P

Are all 3 nodes up & running?
Can you connect to each one
Can they communicate with each other?

Are all 3 nodes up & running?
Yes.

Can you connect to each one
Yes. Able to connect mongo instance on all the 3 nodes.

Can they communicate with each other?
Yes. Can ping each other on all the 3 nodes.

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.

1 Like

I think it is the firewall issue. Working with system admin to check.

The error below seems to indicate DNS configuration error for the host poc-mongo-03.

Make sure all nodes from your replica set can resolve the host name poc-mongo-03 to the same IP address.

I have some doubts about

Please share a screenshot of the ping test.

A firewall issue will not generate a HostNotFound error.

2 Likes

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",*
    
  •    "code" : 74,*
    
  •    "codeName" : "NodeNotFound"*

Can you share whole command rs.initiate commad.
Regards
Prince

This new error message:

Confirms my doubts about

So, again, please

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.

1 Like

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.

mongo --host m3.example.net --port 27017

1 Like