Jan Wieck jan at wi3ck.info
Thu Oct 9 15:31:59 PDT 2014
On 10/09/2014 05:26 PM, Glyn Astill wrote:
>> From: Granthana Biswas <granthana.biswas at gmail.com>
>>To: Glyn Astill <glynastill at yahoo.co.uk>
>>Sent: Thursday, 9 October 2014, 16:34
>>Subject: Re: [Slony1-general] Error with Slony replication from another slony cluster slave
>>
>>
>>
>>Hi Glyn,
>>
>>
>>In my case I have two clusters:
>>
>>
>>Cluster1 ->  replicating from DB1 -> DB2
>>Cluster2 ->  replicating from DB1 -> DB3
>>
>>
>>Can I stop Cluster2 and add DB3 to Cluster1 with DB2 as its master? Or do I have to delete the data first in DB3?
>>
>>
>
> You'll want to run DROP NODE against each node in Cluster2, (or if on 2.0+ you can get away with just DROP SCHEMA _Cluster2 CASCADE) and stop the slons for Cluster2.


Cascading, forwarding and all that is one of the core concepts of Slony. 
If you create one single setup looking like this:

     DB1 -> DB2 -> DB3

then you have a lot more flexibility and functionality than is obvious 
at first. Aside from being able to fail over to DB2.

Slony will let you "MOVE" the master role from DB1 to DB2. That 
operation will not just make DB2 the master, but at the same time DB1 
becomes a replica that doesn't need an initial sync, so your setup now 
would look like this:

     DB1 <- DB2 -> DB3

This is useful if you need to perform some maintenance on DB1. At this 
point DB2 is your master an you would just stop the slon process for 
DB1, do whatever you need to do, and start the slon process again. Once 
DB1 has caught up, you just transfer the master role back and everything 
is as it was.

What also works is that if you need to perform maintenance on DB2, it 
doesn't mean that DB3 has to fall behind too. You can easily change the 
data provider for DB3 to be DB1, so your configuration changes to

     DB1 -> DB2
      |
      V
     DB3

At this point you stop the slon process for DB2, perform what you need 
to do on DB2, start the slon process and after DB2 has caught up, make 
it the data provider for DB3 again.


Regards,
Jan

-- 
Jan Wieck
Senior Software Engineer
http://slony.info


More information about the Slony1-general mailing list