[Csync2] Best practices for multi-way replication?
Giampaolo Tomassoni
g.tomassoni at libero.it
Mon Nov 26 23:06:05 CET 2007
> -----Original Message-----
> From: csync2-bounces at lists.linbit.com [mailto:csync2-
> bounces at lists.linbit.com] On Behalf Of Brett Randall
>
> Hey all
>
> I'm new to csync2. Just set it up today and had it synchronise 60gb of
> data from one side of the country to the other. Great tool, seems to
> work very well. Had the "Establishing SSL connection failed" error
> (running on Debian 4) and the only way I could get it to work was to
> regen the SSL key with "-batch" as other people have found.
>
> 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
>
> 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?
Sorry, I was too fast in replying to your previous question.
My own experience says it is better to avoid this kind of cross-sync
updates: you may easily end up having files not automatically synched only
because they appear as changed on two (or more) systems at the same time.
Please note that change collisions need somehow a manual intervention in
csync2.
Thereby, csycn2 is very useful when at all times you can single out a
"master" system for a given file hierarchy: it doesn't handle multi-master
frameworks very well...
My suggestion is to allow files to change only on a specific system, then
propagate changes to the others. There may be cases in which the whole
system is only apparently a multi-master (like in some multi-MTA setups). In
this case one can gain advantage of csync2 the way you depict. These
systems, however, often need a really careful design and some lucky
condition.
I use csync2 to replicate sites' content from a master to many slaves. When
my users update a file in their sites, the update takes place in the master
system and then gets replicated by mean of csync2 to the other distribution
systems. I also use it to replicate sites' configuration and DNS settings.
I would discourage you from using csync2 to "keep two servers totally
up-to-date". You may synch a part of the VFS's hierarchy, but I think it is
quite unfeasible to replicate a whole VFS from root on: at least some files
in /etc should be different on the two machines in order to get them useful.
Also, who need to replicate /tmp, /var/tmp? Do you know that csync2 keeps a
record of the hierarchies it manages in a db? I wouldn't replicate this
too...
First, you should reply to the following question: are you planning to use
two systems in order to obtain load balancing or failure tolerance? These
are two very different requirements which often clash each other: you can't
easily get both. If you are looking for load-balancing, csync2 may probably
help: simply identify the files being the resources you want to balance in
your net, then use csync2 as an out-of-band way to keep them in synch. If
you are looking for fault-tolerance, you probably are better to look at some
other packages (http://www.linux-ha.org is one of them).
Giampaolo
> Thanks
> --
> Brett Randall
> InterPlanetary Solutions
>
> _______________________________________________
> Csync2 mailing list
> Csync2 at lists.linbit.com
> http://lists.linbit.com/mailman/listinfo/csync2
More information about the Csync2
mailing list