[Csync2] Best practices for multi-way replication?

John Chandler john.chandler at primelocation.com
Wed Dec 5 12:21:27 CET 2007


Hi,

> Anyway, I want to know what the best practice is for keeping two servers
> totally up-to-date with minimal delay. My ideas so far are:
> 
> * Create a script that runs csync2 in a loop. Whenever it finishes,
> start it again.
> * Run it from cron every minute

We have two clustered fileservers for one application - one is the main 
server, the other a backup, with about 260 GB of data (approx 10 million 
files). We're using csync2 to keep the two in synch (admittedly it's 
mainly a one-way process main => backup).

A cron task run every two minutes on each of the servers executes a 
shell script that runs csync2, if it is not currently running.

We run csync2 in server mode on both machines via xinetd.

Only problem is that it is slow (hours rather than minutes) because we 
do a full check each time. I'm currently implementing a system to flag 
new/updated files to reduce the amount of checking csync2 does to speed 
things up considerably. We've hit the limits of inotify, so I'm having 
to go for a custom solution.

> My other problem is, what do I do on the other server(s)? Does it cause
> problems if two servers are both trying to push files to each other at
> the same time? As far as I can tell, this stuff isn't covered in the
> docco so just wondering what people's experiences are?

Most of the time we're pushing one way, but in situations where we've 
tested rolling over to the backup and new/updated data has started going 
to the backup server it's coped fine with files replicating both ways at 
the same time. Worst case, a file will not be replicated first time but 
will go through on the second check - but this seems to be a rare exception.

So far, very happy with it.


John


More information about the Csync2 mailing list