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-20 16:13:13
Message-ID: 021126B987E43D44A860139823C079110E2B72@orion.cdkkt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support


Configuring Replication on Windows,
using pgAdmin3 v8.0 Beta 5
==========================

On Master:
==========
1) Adding a new Master Replication Set:
a) Right-click 'Replication', and select: 'New slony-I Cluster...'
b) UnCheck: Join existing cluster
c) Enter: Cluster name: MasterCluster
d) Enter: Local node: 1: Master Node
e) Enter: Admin node: 99: pgAdmin Node
f) Click: OK

On Slave:
=========
2) Adding a new Slave Replication Set:
a) Right-click 'Replication', and select: 'New slony-I Cluster...'
b) Check: Join existing cluster
[wait for Server dropdown list to complete]
c) Click Server dropdown list and select: <Master host name>
[Cluster name is filled automatically]
[Database is filled automatically]
[Admin Node is filled automatically]
d) Enter: Local node for slave: 2: Slave Node
e) Click: OK

Adding a new Master Path/listener:
a) Refresh and expand all items in the Replication tree
b) Right-click 'Path (0)', under 'Master Node'
and select: 'New Path' menu item
[Server: '2 - Slave Node' appears]
[Conn retry: '10' appears]
Enter: Connect info:
'host=<slave-host> dbname=<database> user=<postgres>'
Click: OK
c) Click on Master Node: listens
[Note that a master listener is automatically added]

Adding a new Slave Path/Listeners:
a) Right-click 'Path (0)', under 'Slave Node'
and select: 'New Path' menu item
[Server: '1 - Master Node' appears]
[Conn retry: '10' appears]
Enter: Connect info:
'host=<master-host> dbname=<database> user=<postgres>'
Click: OK
b) Click on Slave Node: listens
[Note that a slave listener is automatically added]

On Master:
==========
3) Completely refresh the entire 'Replication' tree and expand fully.
[Should see newly added sub-trees: 'Slave Node' and pgAdmin Node]

Adding a new master Path/listeners:
a) Right-click 'Path (0)', under 'Master Node'
and select: 'New Path' menu item
[Server: '2 - Slave Node' appears]
[Conn retry: '10' appears]
Enter: Connect info:
'host=<slave-host> dbname=<database> user=<postgres>'
Click: OK
b) Click on Master Node: listens
[Note that a listener is automatically added]

Adding a new slave Path/listeners:
a) Right-click 'Path (0)', under 'Slave Node'
and select: 'New Path' menu item
[Server: '1 - Master Node' appears]
[Conn retry: '10' appears]
Enter: Connect info:
host=<master-host> dbname=<database> user=<postgres>'
Click: OK
b) Click on Slave Node: listens
[Note that a listener is automatically added]

Adding a new Replication Set:
Right-click 'Replication Sets (0)' and select: 'New Replication Set'
Enter: ID: '1'
Enter: Comment: 'Hardware'
Click: OK
Fully expand tree: 'Replication Sets (1)'

Adding a new table:
Right click: 'Tables (0)' and select: 'New Table'
Click table dropdown list and select: <Database table>
Enter: ID: '1'
Clieck: OK

Adding a new sequence:
Right-click 'Sequences (0)' and select: 'New Sequence'
Click 'Sequence' dropdown list item.
[This step does not work for me, as I find at this point,
there are no sequence dropdown items so a sequence cannot
be created at this point. Otherwise if you have a sequence
dropdown item, continue...]
Enter: ID: '2'
Click: OK

Adding a new Subscription:
Right-click 'Subscriptions (0)' and select: 'New Subscription'
[ Origin: '1', appears]
[Provider: '1 - Master Node', appears]
[Reciever: '2 - Slave Node', appears (a single item)]
Check: 'Can forward' [If you want this.]
Click: OK

[At this point, you can check to see that 'Tables (1)' and
'Subscriptions (1)' can be expanded and contains sub-tree items
so if desired, verify that your entries were properly set.]

On Slave:
=========
Adding a new Replication Set:
Right-click 'Replication Sets (0)' and select: 'New Replication Set'
Enter: ID: '1'
Enter: Comment: 'Hardware'
Click: OK
Fully expand tree: 'Replication Sets (1)'

Adding a new table:
Right click: 'Tables (0)' and select: 'New Table'
Click table dropdown list and select: <Database table>
Enter: ID: '1'
Clieck: OK

Adding a new sequence:
Right-click 'Sequences (0)' and select: 'New Sequence'
Click 'Sequence' dropdown list item.
[This step does not work for me, as I find at this point,
there are no sequence dropdown items so a sequence cannot
be created at this point. Otherwise if you have a sequence
dropdown item, continue...]
Enter: ID: '2'
Click: OK

Adding a new Subscription:
Right-click 'Subscriptions (0)' and select: 'New Subscription'
[ Origin: '2', appears]
[Provider: '2 - Slave Node', appears]
[Reciever: '1 - Master Node', appears (single item)]
Check: 'Can forward' [If you want this.]
Click: OK

[At this point, you can check to see that 'Tables (1)' and
'Subscriptions (1)' can be expanded and contains sub-tree items
so if desired, verify that your entries were properly set.]

+ For both Master and Slaves, restart the services via control panel.
+ For pgAdmin3, stop the services and reconnect to ensure all is there.

Notes/Questions:
================
1) At this point, I think configuration is complete? What is not clear
to me is the 'Sequence' in Replication Sets, should there be something
added there? As explained above, I am not able to do this so is this
a required step?

2) Expand the Replication (1) for master and slave. I note the following:
On Master:
a) Master Node: Running PID='not running'
b) Slave Node: Running PID='not running'
On Slave:
a) Master Node: Running PID='not running'
b) Slave Node: Running PID='not running'

I am able to manually run the slons both servers in a command window
with the entries as:
> slon MasterCluster dbname=MyTest user=postgres host=copper.cdkkt.com

Debugging shows no errors. When running, I show that the 'Running PID'
are filled with process ID's as expected. I am able to see that
replication works; updating an item on the master database table updates
the slave database table.

All is fine except that these slons are running as foreground processes
and cannot be backgrounded and killing the command window will terminate
the process! How can I get the slons running without resorting to using
command windows to start the replication processes?
=================

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.487 / Virus Database: 269.13.25/1018 - Release Date: 9/19/2007 3:59 PM

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Leen Besselink 2007-09-20 21:53:55 1.8beta create table crash
Previous Message Dave Page 2007-09-20 15:42:19 Re: Bug in pgadmin (tested on Beta 5)