[Bucardo-general] One Way Syncs

Joshua Tolley josh at endpoint.com
Thu Mar 6 17:29:39 UTC 2014


On Thu, Mar 06, 2014 at 05:09:59PM +0000, Balman, Matthew D. (GSFC-428.0)[Embedded Flight Systems, Inc] wrote:
>    With the v4.99.10 version of Bucardo how can I reliably specify the
>    source and target dbs?

The test suite contains quite a few examples that may be helpful, though
finding and understanding them isn't necessarily immediately obvious. In
t/20-postgres.t, for instance, the test creates several different database
groups with different configurations. Here it creates a group where A is the
master, replicating to a bunch of slaves.

  ## Create a new database group going from A to B and C and D and E
  $t = q{Created a new database group A -> B C D E};
  $res = $bct->ctl('bucardo add dbgroup pg1 A:source B:target C:target
    D:target E:target');
  like ($res, qr/Created database group "pg1"/, $t);

The key line for knowing what to type when doing this yourself is in the call
to $bct->ctl (which simply runs the bucardo script, with the arguments
specified in the call). You could do this by hand by defining databases A
through E and saying:

    bucardo add dbgroup some_name A:source B:target C:target ...

The sync using this database group is created with this code:

  $t = q{Created a new sync for dbgroup pg1};
  $res = $bct->ctl('bucardo add sync pgtest1 relgroup=allpk dbs=pg1
    status=inactive');
  like ($res, qr/Added sync "pgtest1"/, $t);

There are several other group setups given in the test case:

## Create a new database group going from A and B to C and D
$t = q{Created a new database group (A <=> B ) -> C D};
$res = $bct->ctl('bucardo add dbgroup pg2 A:source B:source C D');
like ($res, qr/Created database group "pg2"/, $t);

## Create a new database group going from A and B and C to D
$t = q{Created a new database group (A <=> B <=> C) -> D};
$res = $bct->ctl('bucardo add dbgroup pg3 A:source B:source C:source D');
like ($res, qr/Created database group "pg3"/, $t);

## Create a new database group going from A and B and C and D
$t = q{Created a new database group (A <=> B <=> C <=> D)};
$res = $bct->ctl('bucardo add dbgroup pg4 A:source B:source C:source
D:source');
like ($res, qr/Created database group "pg4"/, $t);

## Create a new database group going between A and B
$t = q{Created a new database group (A <=> B)};
$res = $bct->ctl('bucardo add dbgroup pg5 A:source B:source');
like ($res, qr/Created database group "pg5"/, $t);

I hope this helps.

-- 
Josh Tolley   josh at endpoint.com   801-987-0252
End Point Corporation  http://www.endpoint.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20140306/e220d9a0/attachment.sig>


More information about the Bucardo-general mailing list