Andrew Hammond andrew.george.hammond at gmail.com
Wed Oct 31 16:09:09 PDT 2007
On 10/30/07, Thomas Hallgren <thomas at tada.se> wrote:
>
> Hi,
> I'm trying to wrap my head around Slony-I and how to use it from an
> application server like JBoss with Hibernate. I'm not clear on the
> relationship between actual connections established by a client and
> nodes in the cluster.
>
> Is it true that any connection that is established is either connected
> to a slave or to the master (origin) for a specific replication set?


Yes.

I.e. there's no node in between that will redirect updates to the master
> for the replication set in question?


pgpool-II may do this for you, but I don't think it's very slony aware. Mind
you, I haven't looked at it in ages. Be aware that doing this (having
middleware balance connections between a replica and the origin) is not as
straight forward as it initially appears.

I'm trying to figure out how to do a controlled switchover and the
> implications of doing that. My appservers can work with two different
> connections if needed but it will be somewhat cumbersome if they need to
> change their settings when I do a switchover. Is there a way to do
> switchover and maintain the connection settings (i.e. host, database,
> credentials)? Ideally, the connections should survive the switch.


I am not aware of any tool that supports this. You're asking a heck of a lot
for a connection to survive that kind of thing. IMHO it is a far superior
approach to design your applications to re-connect automatically.

I'm also looking into automatic switchover in case the master fails for
> some reason. The Heartbeat product seems to be useful for this. Are you
> aware of any examples on how to do this? Any pointer or hint would be
> useful.


heartbeat can do this, and there examples of scripts to fire off a failover.
I suggest that you consider your business needs very carefully before
allowing some process to implement an action which can result in the loss of
committed transactions.

I should also point out that if you're using heartbeat, you will have a
virtual IP which is associated with the database. That IP will migrate
between the two machines depending which is currently the origin. You should
use this IP for client connections to the database, but you must NOT use
this IP for the slons.

Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.slony.info/pipermail/slony1-general/attachments/20071031/=
db5d932c/attachment.htm


More information about the Slony1-general mailing list