Dear Sudhakar:
In order to have a node act as Primary it has to get votes from majority of the cluster.
Because you have four members on the replica set, majority is 3. If you reduce the replica set configuration to three then it will only take two votes to be a primary.
You say you want to make 172.25.122.182 as Primary - can you log into that server with "mongo --host 171.25.122.186" ?
Earlier you posted:
monit:RECOVERING> db.printSlaveReplicationInfo()
source:
172.25.122.181:27017 syncedTo: Fri Feb 08 2013 12:14:55 GMT+0000 (UTC)
= 16998 secs ago (4.72hrs)
source:
172.25.122.20:27017 no replication info, yet. State: ARBITER
source:
172.25.122.186:27017 syncedTo: Fri Feb 08 2013 13:49:48 GMT+0000 (UTC)
= 11305 secs ago (3.14hrs)
monit:RECOVERING>
Since 172.25.122.182 is the machine you want to make primary, connect to it via mongo shell and do 'rs.reconfigure' command there.
If you remove the stalest replica from the configuration, the arbiter and 172.25.186.182 will be able to vote it back into primary status,
hopefully then your other secondary can catch up.
Create a config which looks like this:
newconfig = {
"_id" : "monit",
"version" : 21,
"members" : [
{
Once you've restored basic functionality, I would recommend investing time into setting up a more robust cluster, with larger oplogs
and always an odd number of members.
Asya