On 8/29/07, Karl Hennig <[EMAIL PROTECTED]> 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
_______________________________________________
Slony1-general mailing list
[email protected]
http://lists.slony.info/mailman/listinfo/slony1-general

Reply via email to