Tim Goodaire tgoodair
Thu Aug 4 15:44:59 PDT 2005
On Thu, Aug 04, 2005 at 02:49:22PM +0800, Steven Prasetya wrote:
> I created 2 databases (master & slave) and use the following setup script:
> 
> ==================================================
> #!/bin/sh
> CLUSTER=sql_cluster
> DB1=contactdb
> DB2=contactdb_slave
> H1=localhost
> H2=localhost
> U=postgres
> slonik <<_EOF_
> cluster name = $CLUSTER;
> node 1 admin conninfo = 'dbname=$DB1 host=$H1 user=$U';
> node 2 admin conninfo = 'dbname=$DB2 host=$H2 user=$U';
> init cluster (id = 1, comment = 'Node 1');
> create set (id = 1, origin = 1, comment = 'contact table');
> set add table (set id = 1, origin = 1, id = 1, full qualified name =
> 'public.contact', comment = 'Table contact');
> set add sequence (set id = 1, origin = 1, id = 2, full qualified name =
> 'public.contact_seq', comment = 'Sequence contact_seq');
> store node (id = 2, comment = 'Node 2');
> store path (server = 1, client = 2,
> conninfo = 'dbname=$DB1 host=$H1 user=$U');
> store path (server = 2, client = 1,
> conninfo = 'dbname=$DB2 host=$H2 user=$U');
> store listen (origin = 1, provider = 1, receiver = 2);
> store listen (origin = 2, provider = 2, receiver = 1);
> ==================================================
> Then I tried to run a subscribe script below:
> 
> ==================================================
> #!/bin/sh
> CLUSTER=sql_cluster
> DB1=contactdb
> DB2=contactdb_slave
> H1=localhost
> H2=localhost
> U=postgres
> slonik <<_EOF_
> cluster name = $CLUSTER;
> node 1 admin conninfo = 'dbname=$DB1 host=$H1 user=$U';
> node 2 admin conninfo = 'dbname=$DB2 host=$H2 user=$U';
> subscribe set (id = 1, provider = 1, receiver = 2, forward = yes);
> ==================================================
> 
> I got the following error message:
> 
> ==================================================
> <stdin>:4: Error: namespace "_sql_cluster" already exists in database of
> node 1

The above message tells me that you've tried to set up node 1 before,
and that the _sql_cluster schema is already there.

> -bash-3.00$ ./cluster_setup.sh
> -bash-3.00$ ./subscribe.sh
> <stdin>:4: NOTICE:  subscribeSet:: set 1 has no tables - risk of problems -
> see bug 1226
> <stdin>:4: NOTICE:
> http://gborg.postgresql.org/project/slony1/bugs/bugupdate.php?1226
> ==================================================
> 
> The weird thing is, the database is NOT empty. The table "contact" is there,
> so the error message doesn't make sense. Please help. Thanks.

It's not whether the database is empty or not. It's whether set 1 has
tables in it or not. Try running this query in the database on node 1 to 
see if there are any tables in set 1:

SELECT * FROM _sql_cluster.sl_table WHERE tab_set = 1;

-- 
Tim Goodaire    416-673-4126    tgoodair at ca.afilias.info
Database Administrator, Afilias Canada Corp.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://gborg.postgresql.org/pipermail/slony1-general/attachments/20050804/036f8654/attachment.bin


More information about the Slony1-general mailing list