[Csync2] csync2 usage

Lars Ellenberg lars.ellenberg at linbit.com
Thu Apr 22 15:01:47 CEST 2010


On Thu, Apr 22, 2010 at 08:08:13PM +1000, Aristedes Maniatis wrote:
> Sorry for the simple questions, but I'm having trouble with csync2. I'm very familiar with unison and of course rsync, but the database nature of csync2 confuses me.
> 
> I can populate the database with -cr. That takes a non-trivial time. But then csync -M gives me nothing.
> 
> I can use -T and get a very long list of differences. But -x or -u does nothing.

There is a database of "how things looked before".
On check, stat info is compared with that, and corresponding files are
flagged "dirty".
Update will (try to) sync those that are flagged dirty.

> In my initial trial of the technology, I've got one server as the
> master and several slaves (in brackets). Sure I could do the same with
> rsync and more easily, but this is a trial for me to get used to how
> it works.

The initial setup should be done like this:
csync2 -cIr (note the -I for init database) on all nodes,
then, on the "master" only:
csync2 -TUXI
csync2 -ur /

similar procedure should be followed when later adding an additional slave.

> I've got csync2 running on all machines with -ii, except the master
> which runs csync2 under cron. Do I need to be regularly running csync2
> -cr on all machines to make it work?

You may also add a "logout check", or try the inotify thing to put
things into the "hints" table, then later check only those that have
been hinted. But yes, periodically full checks should be done,
unless you are sure by other means that there cannot be changes.

How much data (total size, average size, number of files) are we talking
about?

-- 
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.


More information about the Csync2 mailing list