0

I've set slaveDelay to 600s but when the Primary data change, the Secondary data change immediately. Here's the curent configuration of repl with 2 server.

"members" : [
{
    "_id" : 0,
    "host" : “primary.host1:27017",
    "arbiterOnly" : false,
    "buildIndexes" : true,
    "hidden" : false,
    "priority" : 1,
    "tags" : {

    },
    "slaveDelay" : NumberLong(0),
    "votes" : 1
},
{
    "_id" : 1,
    "host" : “secondary.host2:27017",
    "arbiterOnly" : false,
    "buildIndexes" : true,
    "hidden" : true,
    "priority" : 0,
    "tags" : {

    },
    "slaveDelay" : NumberLong(600),
    "votes" : 1
}]

I don't know where did I go wrong, or how is the slaveDelay work, since the secondary data should update after 600s.

0

If secondary do "initial sync", it will reach primary first, but then it will "sleep" (this case 600 seconds) to fall back and after that, it will keep syncing 600s behind.

You can see that (sleep) in mongod.log if you watch what is happening at end of initial sync. After that sleep, if you look "last" document in opLog, it's time stamp is that 600s behind. Of course you can see that with rs.printSlaveReplicationInfo() too.

| 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.