gurkan at resolution.com gurkan
Wed Nov 22 09:03:31 PST 2006
Hi,
I am working on failover. But I am having problem to restore original master as
a subscriber.
Eventually once I restore original master as a subscriber I will do switchover
from new master to 
original master so that I will have initial slony-I replication set up.

Here is what I am doing
S1. dropdb and createdb on all node1(master),node2,node3
S2. store DB from dump.sql
S4. copy schema from master to slaves
./pg_dump -s -U enterprisedb -h $MASTERHOST -p $MASTERDBPORT $MASTERDBNAME |
./edb-psql -U $REPLICATIONUSER -h $SLAVEHOST1 -p $SLAVEDBPORT1 $SLAVEDBNAME1
./pg_dump -s -U enterprisedb -h $MASTERHOST -p $MASTERDBPORT $MASTERDBNAME |
./edb-psql -U $REPLICATIONUSER -h $SLAVEHOST2 -p $SLAVEDBPORT2 $SLAVEDBNAME2
S5. initalize cluster/tables on master
S6. start relication on master

S7. start replication on node2
S8. subscribe on node2

S9. start replication on node3
S10.subscribe on node3

S11.test replication works fine where node1 is master and node2 and node3 are slaves

S12.shutdwon postgres(edb) on node1(master) as if crashed
S13.run failover on node2(new master) (I have to re-run setsequences for all
tables for insertions)

S14.test replication works fine where node2 is new master and node3 is the only
slave

S15.drop node 1 (original master)

S16.CANNOT RESTORE ORIGINAL MASTER (node1) from scratch as a subscriber here.
(Here I am trying to same thing when I do to store slaves for intial set up,
copying the schema from new master(node2) to node1 and start replication
so that I can start subscribe but

1.when I try to copy schema from node2 to node1 I get some ERRORs
(taking dump to copy schema(only) from new master node2 to node1)
./pg_dump -s -U enterprisedb -h $SLAVEHOST2 -p $SLAVEDBPORT2 $SLAVEDBNAME2 |
./edb-psql -U $REPLICATIONUSER -h $MASTERHOST -p $MASTERDBPORT $MASTERDBNAME
....
CREATE FUNCTION
ERROR:  syntax error at or near "IS" at character 34
LINE 1: COMMENT ON FUNCTION cleanupevent IS 'cleaning old data out o...
...
....
CREATE FUNCTION
ERROR:  syntax error at or near "IS" at character 32
LINE 1: COMMENT ON FUNCTION denyaccess IS 'Trigger function to preve...
...
and for other functions too.

Here should I be taking dump with (-n public) option?
./pg_dump -s -U enterprisedb -h $SLAVEHOST2 -p $SLAVEDBPORT2 $SLAVEDBNAME2 -n
public | ./edb-psql -U $REPLICATIONUSER -h $MASTERHOST -p $MASTERDBPORT
$MASTERDBNAME
Or thoses errors no concern?

2. Then I start replication but gives the mesage below
[enterprisedb at baba1 bin]$ ./edb-replication $CLUSTERNAME "dbname=$MASTERDBNAME
user=$REPLICATIONUSER host=$MASTERHOST port=$MASTERDBPORT"
2006-08-05 12:36:12 CDT CONFIG main: edb-replication version 1.1.5 starting up
2006-08-05 12:36:12 CDT FATAL  main: Node is not initialized properly

I NEED URGENT HELP restoring origianl node1(master) as a subscriber so that I can 
leave it as a slave or do switchover to make it master again.
Thanks for help.

-------------------------------------------------
This mail sent through IMP: www.resolution.com



More information about the Slony1-general mailing list