Re: sync interval time

68 views
Skip to first unread message

Andre de Frere

unread,
Sep 27, 2012, 12:54:14 AM9/27/12
to mongod...@googlegroups.com
Hi Sebastian,

I wonder if you could tell us the problem you are trying to solve.  The autoresync command is used to resync the slave when the slave becomes out of sync with the primary.  Under normal circumstances it should be up to date with the primary and not need to resync.  If your environment is autoresyncing every time it is available to do so, then we should figure out why it is falling out of sync so often.

I'm not aware of any way to reduce or tune the time the slave checks for being out of sync (to trigger an autoresync).  The documentation tells us that it will autoresync if it is 10 secs out of sync with the master.  It also tells us that the autoresync will not happen more than once every ten minutes.  You should not be seeing an autoresync every 2 - 3 minutes.

Have you considered the use of replica sets?  Replica sets are the newer and much improved method to achieve durability, amongst other benefits.  They have many advantages over master-slave replication.

Cheers,
André

On Thursday, September 27, 2012 7:40:16 AM UTC+10, Sebastian Cabeza wrote:
I have 1 slave server running with --autoresync command and I know it syncs automatically every 2.3~ mins. Is there a command or value to configure in mongodb.conf to set this interval of time?

In other words: 

Sync > Every 2.3~ minutes.

I want:

Sync > Every 30 seconds or 1 minute.


How can I configure that?


Thanks in advance!

Sebastian.

Sebastian Cabeza

unread,
Sep 27, 2012, 2:08:07 PM9/27/12
to mongod...@googlegroups.com
André,

Thanks for your response.

I'm new to MongoDB so maybe I didn't explained myself very well. I thought that the sync of the slave in comparison to the master was done by autoresync.
I'm looking to have Master - Slave in separated servers. Currently I have 1 master and 1 slave synchronized and using the slave to make backups.

My main question was if it is possible to make the sync between the slave and the master every 1 min (not full sync, just an "updated" of the data that's missing).

Cheers,
Sebastian.

Andre de Frere

unread,
Sep 27, 2012, 9:42:18 PM9/27/12
to mongod...@googlegroups.com
Hi Sebastian,

The behaviour of Master Slave replication is for the Slave to always keep up to date with the Master.  Autoresync is not required for this behaviour.  

The Slave will always keep more up to date that 1 min of the Master, or it will have fallen out of sync.  If the Slave determines that it is more than 10 seconds ebhind the master, it will either stop replicating (when autoresync is not configured) or fully resynchronise with the Mater (if autoresync is configured).

You can make the sync between to the two slower than the default, by using the "slavedelay" option.  This is specified at the command line with "--slavedelay", and you give it the number of seconds behind the master you want the slave to be.  You can find the documentation for the command here: http://www.mongodb.org/display/DOCS/Master+Slave#MasterSlave-%5Cslavedelay

Regards,
André
Reply all
Reply to author
Forward
0 new messages