activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: [Un]reliable:// network of AMQ brokers with Lingo
Date Thu, 08 Jun 2006 11:04:04 GMT
On 6/7/06, amerigo5 <> wrote:
> red3 wrote:
> >
> >
> > amerigo5 wrote:
> >>
> >> My solution to have a HA system is to combine Network of Brokers and
> >> Master/Slave topologies.
> >>
> >> Assumptions: Network of Brokers is a clustering solution.  Master/Slave
> >> is a replication solution.
> >>
> >> My setup would be:
> >>
> >> 1. Have a network of master brokers ie master1 and master2.
> >> 2. Have 2 slave brokers ie slave1 (master1 slave) and slave2 (master2
> >> slave).  Slave1 and slave2 brokers are not networked.
> >> 3. Configure the slave broker so that when its master broker shuts down
> >> (or fails), it would also shut down (activemq.xml:
> >> shutdownOnMasterFailure=true). Please refer to
> >> for setting this
> >> configuration.
> >>
> >> This is setup is not a perfect HA solution but it is close.
> >>
> >> Thanks.
> >>
> >
> > Forgive my confusion, but James said that master/slave was probably the
> > situation we want, since we want to failover to the slave broker in the
> > event that the master fails.
> >
> > However, you are telling me that the failover is a feature of the network
> > of brokers, and to shut down the slave in the event of master failure and
> > failover to the other master/slave combination.
> >
> > On top of this we have encountered some serious anomolies in networked
> > broker scenarios (with ActiveMQ 3) and have had to switch back to using
> > just one ActiveMQ broker in production.
> >
> > Could you (or someone) please clarify?
> >
> >
> If I am not mistaken, the failover is not a feature of network brokers and
> master/slave topologies.  Failover is handled by the JMS client or other
> failover solutions.
> For the failover to work, the JMS client must be aware of the brokers in the
> network (failover:(tcp://master1:61616,tcp://master2:61616)).  Please refer
> to for configuring
> the client connection.

Agreed. Its a complex area this isn't it :)

So failover of connections is a client side feature- if the broker
goes down the client can failover to another broker and resend any
in-progress messages and acknowledgements.

The problem with networks is that they are simple store/forward by
nature - a message is owned by one broker or the other. If a broker
goes down, messages stay on that failed brokers disk until it comes
back up. For some folks this is fine.

The problem though is that you may get duplicates or out of order
issues with queues if you use a store/forward network as an attempt at
making a HA cluster - since in a network one broker just forwards
things to another - there is no master/slave synchronisation.

With master/slave on the other hand, the slave is fully aware of whats
going on, what the master is doing and so if a failure occurs, the
clients can replay any in-progress messages/acks and things work as
you'd expect.

In many ways, the ActiveMQ project should have done Master/Slave first
- since thats what most people actually want and the main use case for
why people try to use networks - then done store/forward networks
afterwards which is a much less used feature. e.g. store/forward is
good for doing WAN optimisations, moving messages from one broker to
another due to the location of consumers and producers being separated
over a WAN etc.

i.e. you can use networks to kinda do a kinda HA cluster, but it can
lead to duplicates and can lead to messages sat on a disk for a long
time until the old broker comes back. With Master/Slave you can loose
the entire machine & hard disk of the master and you don't loose a
message or get duplicates; things just work.

So if you are ever in doubt, just use master/slave :). Networks are
really only for store/forward only


View raw message