Pergunta

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.

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a dba.stackexchange
scroll top