I have a 3 members replica set version 2.6.1 with following configuration

                    "_id" : 0,
                    "host" : "",
                    "priority" : 2

                    "_id" : 1,
                    "host" : ""

                    "_id" : 2,
                    "host" : "",
                    "priority" : 0,
                    "slaveDelay" : 3600,
                    "hidden" : true

And i want id:2 to sync from id:1.

I execute

db.adminCommand( { replSetSyncFrom: "" } ) 

and got

"syncFromRequested" : "",
"prevSyncTarget" : "",
"ok" : 1

But on rs.status the sync is still syncingTo : ""

I found on documentation:

Changed in version 2.4: The sync target falls more than 30 seconds behind another member of the replica set; the mongod will revert to the default sync target.

Is this what happened in my case? if yes is there any workaround?


There isn't enough information here to know if the "sync target falling more than 30s behind" was the case, but it seems likely if you are pushing through a lot of activity with all of your replica set nodes on the same machine.

There should be some log entries confirming the change; if you're still on 2.6 you should be able to grep for:

 changing sync target because current sync target's most recent OpTime is

One thing to note is that rs.syncFrom() is a temporary change. By default the sync targets are automatically chosen by MongoDB, and will be reset if you restart instances or lose connectivity.

There's a helpful open source tool called Edda which you can use to process MongoDB log files and visualise changes in replica set history. NOTE: The github repository has changed since that blog post was published; the current repo is 10gen-labs/edda.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.