I am trying to create a replica set with two replicas and one arbiter. All members are launched using:
mongod --port 25670 --dbpath /data --replSet rs0
The data directory is an empty directory.
On one of the replicas I run rs.initiate but I get the error
replSetReconfig should only be run on PRIMARY, but my state is STARTUP2
I have tried waiting for a PRIMARY to be elected but even after two minutes, I see no indication that an election has taken place.
How do I force the replica set to elect a PRIMARY? Or is there a way to predict the PRIMARY?
STARTUP2state? This state suggests that the member you are trying tors.initiate()on may already be in the process of initial sync. What specific version of MongoDB are you trying to install? What is the output ofrs.status()on the member you are trying to initiate as a primary? - Stennie