Re: Implementing Replication via pgAdmin

From: "Daniel B(dot) Thurman" <dant(at)cdkkt(dot)com>
To: "Pgadmin-Support \(E-mail\)" <pgadmin-support(at)postgresql(dot)org>
Subject: Re: Implementing Replication via pgAdmin
Date: 2007-09-18 23:05:55
Message-ID: 021126B987E43D44A860139823C079110E2B6B@orion.cdkkt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support


I have gone over the following document:
http://www.slony.info/documentation/firstdb.html

To get some idea of what is going on (at the manual level)
as to how replication services works. From what I have done,
was to manually start the slon for the master and server sides
the following:

MASTER:
1) Set the privileges for the MyTest database so as to allow
postgres user to access the table completely (ALL)
2) In the windows command window:
a) set path variable to include the path to postgreSQL/bin
b) set PGUSER=postgre
c) set PGPASSWORD=*****
d)
slon Copper-Master-Cluster dbname=MyTest user=postgres host=copper.cdkkt.com
<a gadzillion debug messages are shown. Make sure there are no errors reported>
[I found initially tho, that slon complained that myTest did not exist, and I
found that my entries in BOTH of server sides in the Replication tree contained
a couple of dbname=myTest when they should have been dbname=MyTest (I did not
know they were case sensitive), so I updated the entries via pgAdmin interface
to proper values, then retried slon again, and the errors disappeared!]

SLAVE:
1) Set the privileges for the MyTest database so as to allow
postgres user to access the table completely (ALL)
2) In the windows command window:
a) set path variable to include the path to postgreSQL/bin
b) set PGUSER=postgre
c) set PGPASSWORD=*****
d)
slon Copper-Master-Cluster dbname=MyTest user=postgres host=raider.cdkkt.com
<a gadzillion debug messages are shown. Make sure there are no errors reported>
[I found an error reported for "duplicate key" violation on sl_table_tab_reliod_key
and I compared the value of 18989 against that of the master side and the value
there was found to be: 18988. So I updated the slave side value to 18988 to match,
updated the table, and the error disappeared and replication went on smoothly!]

I found that, if PGPASSWORD was not supplied, the connection will fail since slon
could not find the password, even if I provided the .pgpass file with the correct
information.

I had tested replication by changing a value in one of the columns in the MyTest.car
table and lo' and behold! The slave server's MyTest table was updated! For fun, I
also tried the converse, to change a value in the slave side table and the master car
table was not updated (as expected).

Now... here comes the hard part...

How to I put this slon replication service "into the background" on windows or
more to the point, how do I normally start the replication process normally (as
a service?) and not manually as I have done in the above steps?

I noticed that if I tried to "start" the replication via pgAdmin3 w/o having the
slon programs running by selecting: "Restart Node" menu item when slon replication
programs are not running on either the master or slaves, it would simply pop up an
error message saying that the replication services are not 'running'. Shouldn't
there be some sort of a 'Start Node', 'Stop Node' type of menu item or what?

Again, what is the proper way to start the replication service w/o having to open
a command window and manually start it in the manner as I have done above?

Thanks!
Dan

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.487 / Virus Database: 269.13.22/1013 - Release Date: 9/17/2007 1:29 PM

Browse pgadmin-support by date

  From Date Subject
Next Message Hiroshi Saito 2007-09-19 06:56:06 Re: pgAdmin3, v1.8.0 BETA-5
Previous Message Dave Page 2007-09-18 14:05:55 Re: pgAdmin3, v1.8.0 BETA-5