Karl Hennig karl_hennig at yahoo.com
Thu Aug 30 12:12:15 PDT 2007
Mikko,

Thanks for your help.  You're correct -- I came from the MySQL world and mixed
up the terms schema and database.

In my case, A and B are different schemas but they are ALSO in different
databases.  They are not part of the same DB.

With the help of the guys on the IRC channel, I got things working by setting
up a different cluster for each DB.  Is that the only way to do it?

Thanks again.


--- Mikko Partio <mpartio at gmail.com> wrote:

> On 8/29/07, Karl Hennig <karl_hennig at yahoo.com> wrote:
> >
> > Hello,
> >
> > I'm setting up slony to replicate multiple schemas from a single master DB
> > to a single slave DB.  I successfully got one schema to replicate but am
> > having trouble with the second one.
> 
> 
> 
> You seem to have mixed up databases and schemas:
> 
> Here's how it's set up:
> > DB Server #1 (master): holds schema A and schema B
> > DB Server #2 (slave): holds schema A and schema B
> >
> > Schema A is replicating as expected but nothing is replicated for schema
> > B.
> >
> > I tried modifying the tutorial slonik input to add schema B as follows:
> >
> > cluster name = $CLUSTERNAME;
> >
> > node 1 admin conninfo = 'dbname=A host=$MASTERHOST user=$REPLICATIONUSER';
> >
> > node 2 admin conninfo = 'dbname=A_slave host=$SLAVEHOST
> > user=$REPLICATIONUSER';
> >
> > # new nodes 3 and 4 added for schema B
> > node 3 admin conninfo = 'dbname=B host=$MASTERHOST user=$REPLICATIONUSER';
> >
> > node 4 admin conninfo = 'dbname=B_slave host=$SLAVEHOST
> > user=$REPLICATIONUSER';
> 
> 
> 
> Nodes 3 and 4 are not needed since both schemas are in the same database.
> 
> 
> # init... am I supposed to init a second cluster with the node ID for schema
> > B?
> > init cluster ( id=1, comment = 'Master Node for A');
> > init cluster ( id=3, comment = 'Master Node for B');
> >
> > create set (id=1, origin=1, comment='schema A tables');
> > # I put id=2 and origin=3 because schema B's set should come from node #3
> > create set (id=2, origin=3, comment='schema B tables');
> >
> > set add table (
> >             set id=1,
> >                 origin=1,
> >                 id=1,
> >                 fully qualified name = 'public.table1',
> >                 comment='table1 in schema A'
> >         );
> >
> > set add table (
> >             set id=2,
> >                 origin=3,
> >                 id=1,
> >                 fully qualified name = 'public.table1',
> >                 comment='table1 in schema B'
> >         );
> 
> 
> 
> Both tables here are at the same schema (public). Just specify the schema in
> the set add table, eg.
> 
> set add table (
>             set id=1,
>                 origin=1,
>                 id=1,
>                 fully qualified name = 'schemaA.table1',
>                 comment='table1 in schema A'
>         );
> 
> and
> 
> 
> set add table (
>             set id=2,
>                 origin=1,
>                 id=2,
>                 fully qualified name = 'schemaB.table1',
>                 comment='table1 in schema B'
>         );
> 
> 
> Regards
> 
> MP
> 



       
____________________________________________________________________________________
Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/


More information about the Slony1-general mailing list