Tang, Jason jason.tang
Wed Jun 15 10:52:11 PDT 2005
Hi there
 
Try adapting the below snippet for your environment. I currently have a script that contains this which I use to 'start again from square one'
 
slonik <_EOF_
cluster name = $CLUSTER;
 
node 1 admin conninfo = 'dbname=$DBNAME1 host=$HOST1 user=$SLONY_USER';
node 2 admin conninfo = 'dbname=$DBNAME2 host=$HOST2 user=$SLONY_USER';
uninstall node ( id = 1 );
uninstall node ( id = 2 );
_EOF_
 
-----Original Message-----
From: slony1-general-bounces at gborg.postgresql.org [mailto:slony1-general-bounces at gborg.postgresql.org] On Behalf Of St?phane P?trot
Sent: 15 June 2005 10:43
To: slony1-general at gborg.postgresql.org
Subject: [Slony1-general] ERROR: namespace "_cluster" already exists indatabase of node 1
 
Hello,

I have run once the slony_setup.sh script that configures nodes. For me it looks like (the begining of script):

#!/bin/sh

PGBINDIR=/usr/lib/postgresql 
/bin
export PGBINDIR
PATH="$PGBINDIR:$PATH"
export PATH

slonik <<_EOF_
        # ----
        define asterix_node 1;
        define obelix_node 2;
        define idefix_node 3;

        # ----
        # This defines which namespace the replication system uses
        # ----
        cluster name = $CLUSTERNAME;

        # ----
        # Admin conninfo's are used by the slonik program to connect
        # to the node databases. So these are the PQconnectdb arguments
        # that connect from the administrators workstation (where
        # slonik is executed).
        # first drop the create nodes
        # ----
        #drop node ( id = @asterix_node);
        #drop node (id = @obelix_node);
        #drop node (id = @idefix_node);
        node 1 admin conninfo = 'dbname=$MASTERDBNAME host=$MLOCALE user=$REPLICATIONUSER';
        #node @obelix_node admin conninfo = 'dbname=$SLAVEDBNAME host=$MDISTANTE user=$REPLICATIONUSER';
        node 3 admin conninfo = 'dbname=$SLAVEDBNAME host=$MDISTANTE2 user=$REPLICATIONUSER';

        # ----
        # Initialize the first node. The id must be 1.
        # This creates the schema "_test1" containing all replication
        # system specific database objects.
        # ----
        init cluster ( id = @asterix_node, comment = 'Master Node 1' );
[...]


Then I had an error about primary_key that was not found. After making correction, I try to run the script again, but I got the error :

>> namespace "_cluster" already exists in database of node 1

Then I have commented out the line init cluster ( id = @asterix_node, comment = 'Master Node 1' ); and add the lines "drop node (id=@asterix_node);..." but I got another error : <stdin>:18: ERROR: syntax error at or near drop

Could you please tell me how to re-initialize the whole process (cluster, node definitions, etc...) ? I was looking for some tables dealing about slony (table like sl_node) but I was not able to find it. Where are they?

Thanks...
St?phane
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gborg.postgresql.org/pipermail/slony1-general/attachments/20050615/88abf652/attachment.html


More information about the Slony1-general mailing list