Christopher Browne cbbrowne at ca.afilias.info
Thu Jan 10 14:40:40 PST 2008
"Jaison J. González Chaux" <g0chman at gmail.com> writes:
> Good evening, my name is Jaison González and I am very interested in knowing a bit more about slony-I, I have read some info found on your  web about slony, because I
> have to install it and make it for academic purposes.
>
> What have I done:

>        set add table (set id=1, origin=1, id=1, fully qualified name=' public.Personas', comment='tabla de Personas del Cluster_1');
>        set add table (set id=1, origin=1, id=2, fully qualified name='public.Personas', comment='tabla de Personas del Cluster_2');
>        set add table (set id=1, origin=1, id=3, fully qualified name='public.Personas', comment='tabla de Personas del Cluster_3');

I see a problem here: you are naming the same table three times.  You
only need to specify that table once.

>        store path (server=1, client=1, conninfo='dbname=DB_Cluster_1 host=127.0.0.1 user=root password=root port=5435');
>        store path (server=1, client=2, conninfo='dbname=DB_Cluster_2 host=127.0.0.1 user=root password=root port=5436');
>        store path (server=1, client=3, conninfo='dbname=DB_Cluster_3 host=127.0.0.1 user=root password=root port=5437');

There is a problem here; you need to have more paths between servers
and clients across the cluster to allow events to propagate around.

The path with "server=1, client=1" is a useless one, as there is no
need for the slon managing node #1 to connect to node #1 to access
events from node #1.

I'd be inclined to instead define paths more like:

        store path (server=1, client=2, ...
        store path (server=1, client=3, ...
        store path (server=2, client=1, ...
        store path (server=2, client=3, ...
        store path (server=3, client=1, ...
        store path (server=3, client=2, ...

>    store listen (origin=1, provider=1, receiver=2);
>    store listen (origin=2, provider=2, receiver=1);
>    store listen (origin=3, provider=3, receiver=1);

In the 1.2 branch of Slony-I, it manages listen paths for you.  This
set is inadequate; for a cluster of 3 nodes, there *MUST* be at least
6 listen paths, so that each node (there are 3 of them) knows how to
receive events from the other nodes (2 remain).  (3 x 2 = 6).

>        If I leave the script like that it says:
>
>        C:\Archivos de programa\PostgreSQL\8.2\bin>slonik config.conf
>
>        config.conf:37: PGRES_FATAL_ERROR select "_Cluster_11".setAddTable(1,  2, 'public.Personas', 'Personas_pkey',  'tabla de Personas  del Cluster_2');   - ERROR: 
>        duplicate key violates unique constraint "sl_table_tab_reloid_key"
>
>        CONTEXTO:  SQL  statement "INSERT INTO  "_Cluster_11".sl_table (tab_id, tab_reloid, tab_relname,  tab_nspname, tab_set,  tab_idxname, tab_altered, tab_comment)
>        values ( $1 ,  $2 , $3 ,  $4 ,  $5 , $6 , false,  $7 )"
>
>        PL/pgSQL function "setaddtable_int" line 103 at SQL statement
>
>        SQL statement "SELECT "_Cluster_11".setAddTable_int( $1 ,  $2 , $3 ,  $4 ,  $5 )"
>
>        PL/pgSQL function "setaddtable" line 37 at perform

These errors are consistent with what I mentioned above, that you ask
to replicate the same table three times.  It is only added to a set
once.


>         And I really dont know  what it is,  then I put  that line on comments  [#set add table  (set id=1,  origin=1,  id=2, fully qualified  name='public.Personas',
>        comment='tabla de Personas del Cluster_2');] and the it happens the samething with the following one
>
>         Well the I decided to leave those two on comments, and then this appears:
>
>        C:\Archivos de programa\PostgreSQL\8.2\bin>slonik config.conf
>
>        config.conf:64: PGRES_FATAL_ERROR select "_Cluster_12".storeListen(2, 2, 1);
>
>         -ERROR: insert or update on table "sl_listen" violates foreign key constraint "sl_listen-sl_path-ref"
>
>        DETALLE:  Key (li_provider,li_receiver)=(2,1) is not present in table "sl_path".
>
>        CONTEXTO:  SQL statement "INSERT INTO "_Cluster_12".sl_listen (li_origin, li_provider, li_receiver) values ( $1 ,  $2 ,  $3 )"
>
>        PL/pgSQL function "storelisten_int" line 36 at SQL statement
>
>        SQL statement "SELECT "_Cluster_12".storeListen_int ( $1 ,  $2 , $3 )"
>
>        PL/pgSQL function "storelisten" line 6 at perform
>
>  And I really don't know why, or well I know that it refers to the store listen part but really don't know how to solve it out...

This reflects the problem that you don't have enough paths stored.
You shouldn't need to specify listen paths anymore as they are
automatically calculated by Slony-I. 

You absolutely need enough paths
defined via STORE PATH in order for events to be able to propagate
from every node to every other node.  For a 3 node cluster, the minimum feasible number of STORE PATH requests would be 3
-- 
output = ("cbbrowne" "@" "ca.afilias.info")
<http://dba2.int.libertyrms.com/>
Christopher Browne
(416) 673-4124 (land)


More information about the Slony1-general mailing list