[Csync2] [gaio at sv.lnf.it: First use and first question...]

Giampaolo Tomassoni g.tomassoni at libero.it
Wed Sep 2 12:42:59 CEST 2009


> I've sent some days ago... no answer... too many questions? ;-)

It maybe. Or people in this list was busy working to something else. It
happens: I believe there are not tons of subscribers to this list.


> ----- Forwarded message from Marco Gaiarin <gaio at sv.lnf.it> -----
> From: Marco Gaiarin <gaio at sv.lnf.it>
> Date: Wed, 26 Aug 2009 18:44:14 +0200
> To: csync2 at lists.linbit.com
> Subject: [Csync2] First use and first question...
> Organization: La Nostra Famiglia - Polo FVG
> 
> 
> I've just arriver to csync2 after some search and after using by some
> years unison as a syncronization tools.
> I'm using it merely to syncronize file repository between LANs, in a
> windows environment (samba servers).
> 
> Unison is an imparable tools for personal use, but lacks some things
> and the unison output are imparsable if you have to automatically
> resolve conflicts or at least track them.
> 
> 
> Csync2 behave better, and the 'multiple host' replica is a very nice
> feature.
> 
> I've some question, and a problem.
> 
> 1) caming from unison i was a bit confused by the fact that the
>  'configuration file' have to be present on every 'server'.
> As a firts start i've put the config file itself on a 'include'
> statement in the main (and also unique) group, so if i modify the
> config file on the 'master', they are replicated on other servers.
> My first example have a master host and some slave (host), and i think
> that this does not pose problem at all, but in general multimaster
> evironment i ask if it is better to add a group in master/slave mode
> that contain only the configuration file.

FWHK, csync2 doesn't fit very well in a multi-master environment.

However, you may work around the problems you may experience in changing the
csync2 config file by replicating it first, in a dedicated session.

The problem is, of course, in the slave. When you start a sync session the
slave csync2 process reads the stale version  of the config file it has, and
keeps working according to its the directives for the whole session
lifetime.

When you make changes in the config file, start a csync2 to replicate only
that file.

I believe you don't need any particular grouping to do this.


> 2) at the fist run my impression was that csync2 transfer *all* the
>  files even if exist on both end, and are the same (minus owner,
> permissione, timestamp, ...).
> This is true?

When files are the same in both the master and the slaves, you should see a
message like:

	Updating /some/dir/some.file on some.slave ...
		File is already up to date on peer.

When files differ in content, then csync2 updates it unless you're running
the first sync session OR the slave file got changed with respect to the
last sync session. In that case you get a synchronization conflict.

Again, csync2 is not well suited in a multi-master environments: you may
expect a conflict if somebody changes the content of a file in a slave.


> 3) I've started my example with a master and a slave (-xr), and then
> added
>  two more slaves... (another -xr) discovering that no files was
> syncronized, because on master no files was effectively changed.
> I'm a bit confused on -x, -c, -I, -T options... someone can explain me,
> or point me to some documentation?

Csync2 uses a sqlite db to keep track of "dirty" files, i.e. files which had
been modified in the master and not yet updated to the slave(s). When you
sync, the list of dirty files gets emptied. If you then add a further slave
and attempt to sync it, you get not file to transfer.

You have the option to use the -I flag in order to resync the whole set of
slaves after adding a new one.


> The problem, that unison does not solve but even csync2 not: ACLs.
> Some of my shares have ACLs (POSIX ones, with extended attributes
> handled by samba), and i need to migrate them.
> Apart asking to add in csync2 ACL and ATTR suport, i was thinking about
> adding an action script that simply run an getfacl on remote side and a
> setfacl --set-file=- on local side.
> 
> Someone have done some sort of hacks like this?

Not to my knowledge.

Marco, apart your ACLs whish, which I think may eventually fit into csync2,
I have the feeling you're using the wrong tool.

csync2 is designed to complete syncs consuming very low bandwidth, but it
doesn't work well when changes are often expected in slaves.

Since you're instead working on a LAN and have probably plenty of bandwidth,
I would look for something else. Samba has recently improved DFS support, in
example. Or you could use something like GFS. 

Basically, you want changes to a file in a server to be immediately
propagated to the other servers, right?

Giampaolo

> many thanks.
> 
> --
> dott. Marco Gaiarin				    GNUPG Key ID: 240A3D66
>   Associazione ``La Nostra Famiglia''
> http://www.sv.lnf.it/
>   Polo FVG  -  Via della Bontà, 7 - 33078  -  San Vito al Tagliamento
> (PN)
>   marco.gaiarin(at)sv.lnf.it	  tel +39-0434-842711  fax +39-0434-
> 842797
> 
> 		Dona il 5 PER MILLE a LA NOSTRA FAMIGLIA!
> 	   http://www.lanostrafamiglia.it/chi_siamo/5xmille.php
> 	(cf 00307430132, categoria ONLUS oppure RICERCA SANITARIA)
> _______________________________________________
> Csync2 mailing list
> Csync2 at lists.linbit.com
> http://lists.linbit.com/mailman/listinfo/csync2
> 
> ----- End forwarded message -----
> 
> --
> dott. Marco Gaiarin				    GNUPG Key ID: 240A3D66
>   Associazione ``La Nostra Famiglia''
> http://www.sv.lnf.it/
>   Polo FVG  -  Via della Bontà, 7 - 33078  -  San Vito al Tagliamento
> (PN)
>   marco.gaiarin(at)sv.lnf.it	  tel +39-0434-842711  fax +39-0434-
> 842797
> 
> 		Dona il 5 PER MILLE a LA NOSTRA FAMIGLIA!
> 	   http://www.lanostrafamiglia.it/chi_siamo/5xmille.php
> 	(cf 00307430132, categoria ONLUS oppure RICERCA SANITARIA)
> _______________________________________________
> Csync2 mailing list
> Csync2 at lists.linbit.com
> http://lists.linbit.com/mailman/listinfo/csync2



More information about the Csync2 mailing list