quinn quinn_jones at pobox.com
Tue Oct 21 16:42:07 PDT 2008
AmMarya at symcor.com wrote:
> Hi,
>
> I have set up replication between 2 PostgreSQL servers using SLONY - I. One
> is a Master and the 2nd one is a Slave. I am planning to add more Slave
> servers to this setup. In effect the plan is to set up a chain (i.e. Slave
> 1 subscribes to Master, Slave 2 subscribes to Slave 1, Slave 3 subscribes
> to Slave 2 ... and so on).
>
> I have the following questions:
>
> 1.    If one of the slave node goes down, will Slony be able to
> automatically detect that it has gone down? If no, what is the best way to
> receive notification    when one or more slave goes down?
>   
Slony doesn't have any detection built in.  What should happen when a
slave goes down is a business decision.  What should happen when a node
goes down?  How would your users and applications know which node to
communicate with?
To quote from the manual
(http://slony.info/documentation/slonyintro.html): "... choosing what to
do based on the 'shape' of the cluster represents local business policy,
particularly in view of the fact that FAIL OVER
<http://slony.info/documentation/stmtfailover.html> requires discarding
the failed node. If Slony-I imposed failover policy on you, that might
conflict with business requirements, thereby making Slony-I an
unacceptable choice."
In my case, we use Heartbeat (http://www.linux-ha.org/) and mon together
to monitor our databases and automate failover, and Nagios
(http://www.nagios.org/) to test the state of our nodes and alert us to
non-critical problems.
> 2.    If one of the slave node goes down, will replication continue over to
> the next Slave(s) in the chain? (ie. if Slave 2 goes down, would the
> replication             automatically go from Slave 1 to Slave 3 to keep
> the chain running?) If no, what needs to be done to get the chain to
> continue?
>   
Quick answer: no, not with your proposed configuration.  Part of your
failover procedure should include re-subscribing the node farther down
the chain (SUBSCRIBE SET) to a good node farther up the chain.  See
http://slony.info/documentation/reshape.html for details.
If each slave node subscribed to the master, then there would no chain
to break.  In your case, you're intentionally configuring a chain which
could be broken.  If you're worried about losing subscriptions, you may
want to try a different cluster shape.
If you're setting up a chain because you're trying to avoid bottlenecks,
you may not need to worry.  We have several clusters that are on WANs,
replicating two or more nodes across the same connection.  Latency isn't
a problem except for initial sync, which only happens once.
> 3.    If a slave node goes down, what is the process after it is back
> on-line to reset the chain and synchronize the data? (i.e. if Slave 2 goes
> down and the            chain is then running as Master .. Slave 1 ...
> Slave 3 ... and so on, when Slave 2 is ready and back on-line, how do we
> insert it back in the chain so that       the chain is back to original and
> synchronize the data as well)?
>   
You would use SUBSCRIBE SET, similar to what was addressed in question
2.  It seems like you're doing something different, but really you're
not.  It's a different case of the same procedure.
> Thanks a lot in advance,
>
> If you can reply to ammarya at symcor.com, it would be greatly appreciated.
>
> Regards,
>
> Amit
>
>   
Hope this helps.

Quinn


More information about the Slony1-general mailing list