Rs.initiate() Not completing

I am trying to bring up a 3 node replicaSet using rs.initiate().

It is not working every time, I am getting the following timeout error.

raise ServerSelectionTimeoutError((self._error_message(selector), timeout, self.description))E               
pymongo.errors.ServerSelectionTimeoutError: No replica set members match selector "Primary()", 
Timeout: 30s, 
Topology Description: <TopologyDescription 
id: 612dbc413af5ded662893f8b, 
topology_type: ReplicaSetNoPrimary, 
servers: [<ServerDescription ('', 27017) 
server_type: RSGhost, rtt: 0.0014995487034320835>]>

I have few questions here:

  1. Why does the rs.initiate() is taking so much time? (I am waiting for rs.initiate for around 200 seconds).
  2. Is it the election process that is taking more time as part of rs.initiate() ?
  3. Typically how much time rs.initiate() will take.
  4. How can we decrease the amount time rs.initiate() is taking?

Any help will be highly appreciated.

Not aware of any rs.initiate() in M001-basics
Which lab are you trying to do?
You have to give more details
“No replica set members match selector “Primary()” Are your 3 nodes up?
Your configuration details
Are you trying this on your local host or IDE?

Hey @Guntur_Sai_Nikhil,

Welcome to the MongoDB Community Forums :sparkles:

You can refer to the documentation here for deploying 3 nodes replicas set.

I suspect calling rs.initiate() (i.e. without a configuration object) is causing longer response time.

I hope it helps!


Hi Kushagra,

My problem is resolved. Actually the IPs addresses being used for making the replica set are having few issues and they are not accessible. Hence the replicaset is getting timed out and taking a lot of time.

Thank you for the response. It surely gave insights.

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