[Csync2] -T shows files with "L", but -u doesn't transfer tehm
Lars Ellenberg
lars.ellenberg at linbit.com
Fri May 25 01:24:12 CEST 2012
On Thu, May 24, 2012 at 01:57:58PM -0700, Dustin Mitchell wrote:
> Apologies for the self-reply, but I've replicated in a simpler case.
>
> Set up /tmp/bar on nodes A and B with /etc/csync2_bar.cfg:
>
> group foo {
> host A;
> host B;
> key /etc/csync2/keys/bar.key;
> include /tmp/bar;
> auto first;
> }
>
> and put /tmp/bar/fromA in the dir on A, and similarly on B.
>
> Run 'csync2 -x -C bar' on both hosts.
>
> Each now has /tmp/bar/from{A,B}, as expected.
>
> Now, add a node C, update all configs to contain
>
> group foo {
> host A;
> host B;
> host C;
> key /etc/csync2/keys/bar.key;
> include /tmp/bar;
> auto first;
> }
>
> and put /tmp/bar/fromC on node C.
>
> Run 'csync -x -C bar' to your heart's content on all three nodes.
>
> On A and B you will see /tmp/bar/from{A,B,C}.
> On C you will see /tmp/bar/fromC only.
>
> This is with csync2 version 2.0.
>
> In this test situation, the only fix I've found is to blow away the DB
> on node A or B. Once that db is reconstructed and things are
> synchronized, new files get distributed as expected.
>
> I'm also using csync2 to synchronize large yum repositories, so this
> is hardly a happy step to have to take when putting a new node into a
> cluster!
You have been on the right path with csync2 -T.
-TI would have gotten you one step further.
:-)
Howto integrate a new host into an existing csync2 setup.
* edit the config files, everywhere, so they know each other.
* make sure your old hosts are "in good order":
A# csync2 -x
B# csync2 -x
* if you have already files on the new node to be synced,
now would be a good time
C# csync2 -x
If you'd rather chose one of the existing hosts to be "master",
and have the new host become a clone of that, *instead* do
just initialize the database on the new host with the current state
C# csync2 -cIr /
* on the old hosts, compare the database with the other node's databases
A# csync2 -TUXI; csync2 -u
B# csync2 -TUXI; csync2 -u
assuming A and B are properly in sync already,
doing so on one is sufficient.
Careful, this may schedule stuff for deletion if it is missing from
the local database, but present on the remote side.
(That's the -X modifier).
That should be it.
Cheers,
Lars
--
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com
More information about the Csync2
mailing list