Replica Set Error

I want to build a replica set. The conf files of my 3 machines are attached. I booted the primary machine. The process started correctly. However, I cannot add the 2nd and 3rd machines, that is, the secondry machines.
The error I get when I run the rs.add(“192.168.122.203:27017”) command; “errmsg” : “Quorum check failed because not enough voting nodes responded; required 2 but only the following 1 voting nodes responded: 192.168.122.201:27017; the following nodes did not respond affirmatively: 192.168.122.203:27017 failed with No route to Shoo”. I would be glad if you help.

systemLog:
   destination: file
   path: "/Products/mongodb/mongod.log"
   logAppend: true
storage:
   dbPath: "/Products/mongo_data_db"
processManagement:
   fork: true
net:
   bindIp: 0.0.0.0
   port: 27017
setParameter:
   enableLocalhostAuthBypass: false
security:      
   keyFile: /Products/mongo_data_db/keyfile/keyfile
replication:   
   replSetName: myRS
MongoDB Enterprise myRS:PRIMARY> rs.add("192.168.122.203")
{
        "ok" : 0,
        "errmsg" : "Quorum check failed because not enough voting nodes responded; required 2 but only the following 1 voting nodes responded: 192.168.122.201:27017; the following nodes did not respond affirmatively: 192.168.122.203:27017 failed with No route to host",
        "code" : 74,
        "codeName" : "NodeNotFound",
        "operationTime" : Timestamp(1660130888, 1),
        "$clusterTime" : {
                "clusterTime" : Timestamp(1660130888, 1),
                "signature" : {
                        "hash" : BinData(0,"GFhdtq3hWCB/5TmETZYit5ALHic="),
                        "keyId" : NumberLong("7129808885757509634")
                }
        }
}

@Stennie The error I get is not related to the conf.
the process is working properly. conf seems to be wrong while typing here.The real problem is rs.add()

Can the primary reach the secondary machines? What is the result of running ping 192.168.122.203 from the primary? No route to host sounds like a networking issue.

1 Like

Hi @Ayberk_Cengiz,

Probably not related to your connectivity issue, but FYI you will need the same keyFile configuration on your other replica set members.

Since you are on a private network, you may want to get basic networking working before enabling additional configuration.

The error message is about connectivity to the member you’re trying to add:

192.168.122.203:27017 failed with No route to host

As a start I would try to ping and make sure your replica set members all have a known route to the other replica set member IPs.

Can you please provide some more details about your deployment:

  • Are you using the same config file for all replica set members?

  • Are the replica set members on different machines or are they VMs or containers on the same host?

  • Are there any firewalls that might be blocking communication between replica set members?

  • What O/S version are you using?

  • What specific version of MongoDB server are you using?

Thanks,
Stennie

accessible
ping 192.168.122.202
PING 192.168.122.202 (192.168.122.202) 56(84) bytes of data.
64 bytes from 192.168.122.202: icmp_seq=1 ttl=64 time=0.457 ms
64 bytes from 192.168.122.202: icmp_seq=2 ttl=64 time=0.436 ms
64 bytes from 192.168.122.202: icmp_seq=3 ttl=64 time=0.432 ms

1-)I am using the same config file for all replica sets.
2-)3 different machines installed on securecrt on my main computer.
3-)
4-)NAME=“Red Hat Enterprise Linux Server”
VERSION=“7.9 (Maipo)”
5-)3.6.8 enterprise

Hi are these on separate VMs? the error “no route to host” suggests that the FW is not open. You can check this very easily by doing a telnet secondary_ip mongod_port from the primary and see if it can can connect. Even though the ping succeeds you need to validate on the specific mongod port.

if that fails it means there is a FW blocking it (probably the default rhel FW) so you can open it and then try again.

2 Likes

Is there a reason that you’re running version 3.6.8? Support for this version ended in April of 2021. If you’re setting up a production system, I would recommend going to either 5.0 or 6.0 (recently released) depending on your comfort level. Even if this is a test system, I would recommend a newer version of MongoDB so that you get all the newer features, as well as the latest security, stability and performance patches.

1 Like

Conscious, it has to be.

The problem was related to linux. Solved

1 Like

Could you please provide more details about the root cause of the problem and about the solution? This would help others that may face the same issue.

1 Like

The problem here is related to linux. I disabled the service called iptables first. Then I repeated the process and the problem was solved.
#systemctl disable iptables

What you did is risky. You disabled your firewall.

Check https://www.mongodb.com/docs/manual/tutorial/configure-linux-iptables-firewall/

1 Like

Of course there is risk. This was necessary to access the ports. After access, the security problem can be solved again.

In the future you can just open the mongo ports that you are using with Bi-directional connectivity.

2 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.