Adding a replica in MongoDB throws an error

compuhosny picture compuhosny · May 27, 2015 · Viewed 18.5k times · Source

I'm trying to add a node to a replica set using rs.add("developer-ViratualBox:30103") and I'm getting the following error message:

{
"ok" : 0,
"errmsg" : "Quorum check failed because not enough voting nodes responded; required 2 but only the following 1 voting nodes responded: developer-VirtualBox:30101; the following nodes did not respond affirmatively: developer-ViratualBox:30103 failed with Failed attempt to connect to developer-ViratualBox:30103; couldn't initialize connection to host developer-ViratualBox, address is invalid",
"code" : 74
}

The node is already running and I'm connected to it using mongo shell. What could possibly be the problem?

Answer

Laxmikant Dange picture Laxmikant Dange · Oct 27, 2015

The actual error is couldn't initialize connection to host developer-ViratualBox, address is invalid, Simply the primary node is not able to connect with secondery nodes. check connections, firewall, and check connection with mongo shell whether you can access that port or not.