blob: b732abf14d350a3a375fe07d614741b5ee6c9b9d [file] [log] [blame]
<div class="docbook"><div class="navheader"><table summary="Navigation header" width="100%"><tr><th align="center" colspan="3">10.2.&#160;High Availability Overview</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="Java-Broker-High-Availability.html">Prev</a>&#160;</td><th align="center" width="60%">Chapter&#160;10.&#160;High Availability</th><td align="right" width="20%">&#160;<a accesskey="n" href="Java-Broker-High-Availability-CreatingGroup.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Java-Broker-High-Availability-OverviewOfHA"></a>10.2.&#160;High Availability Overview</h2></div></div></div><p>The Broker provides a HA implementation offering an <span class="bold"><strong>Active/Passive</strong></span> mode of operation.
When using HA, many instances of the Broker work together to form an high availability group of two or more nodes.</p><p>The remainder of this section now talks about the specifics of how HA is achieved in terms
of the <a class="link" href="Java-Broker-Concepts.html" title="Chapter&#160;4.&#160;Concepts">concepts</a> introduced earlier in this
book.</p><p>The <a class="link" href="Java-Broker-Concepts-Virtualhosts.html" title="4.5.&#160;Virtualhosts">Virtualhost</a> is the unit of
replication. This means that any <span class="emphasis"><em>durable</em></span> queues, exchanges, and bindings
belonging to that virtualhost, any <span class="emphasis"><em>persistent</em></span> messages contained within
the queues and any attribute settings applied to the virtualhost itself are automatically
replicated to all nodes within the group.<a class="footnote" href="#ftn.d0e6591" id="d0e6591"><sup class="footnote">[11]</sup></a></p><p>It is the <a class="link" href="Java-Broker-Concepts-Virtualhost-Nodes.html" title="4.3.&#160;Virtualhost Nodes">Virtualhost Nodes</a>
(from different Broker instances) that join together to form a group. The virtualhost nodes
collectively to coordinate the group: they organise replication between the master and
replicas and conduct elections to determine who becomes the new master in the event of the old
failing.</p><p>When a virtualhost node is in the <span class="emphasis"><em>master</em></span> role, the virtualhost
beneath it is available for messaging work. Any write operations sent to the virtualhost are
automatically replicated to all other nodes in group.</p><p>When a virtualhost node is in the <span class="emphasis"><em>replica</em></span> role, the virtualhost
beneath it is always unavailable for message work. Any attempted connections to a virtualhost
in this state are automatically turned away, allowing a messaging client to discover where the
master currently resides. When in replica role, the node sole responsibility is to consume a
replication stream in order that it remains up to date with the master.</p><p>Messaging clients discover the active virtualhost.This can be achieved using a static
technique (for instance, a failover url (a feature of the Apache Qpid JMS and Apache Qpid JMS AMQP 0-x clients),
or a dynamic one utilising some kind of proxy or virtual IP (VIP).</p><p>The figure that follows illustrates a group formed of three virtualhost nodes from three
separate Broker instances. A client is connected to the virtualhost node that is in the master
role. The two virtualhost nodes <code class="literal">weather1</code> and <code class="literal">weather3</code>
are replicas and are receiving a stream of updates.</p><div class="figure"><a id="Java-Broker-High-Availability-OverviewOfHA-Figure"></a><p class="title"><strong>Figure&#160;10.1.&#160;3-node group deployed across three Brokers.</strong></p><div class="figure-contents"><div class="mediaobject"><img alt="Diagram showing a 3 node group deployed across three Brokers" src="images/HA-Overview.png" /></div></div></div><br class="figure-break" /><p>Currently, the only virtualhost/virtualhost node type offering HA is BDB HA. Internally,
this leverages the HA capabilities of the Berkeley DB JE edition.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>The HA solution from the Apache Qpid Broker-J is incompatible with the HA solution offered by the CPP
Broker. It is not possible to co-locate Qpid Broker-J and CPP Brokers within the same group.</p></div><div class="footnotes"><br /><hr style="width:100; text-align:left;margin-left: 0" /><div class="footnote" id="ftn.d0e6591"><p><a class="para" href="#d0e6591"><sup class="para">[11] </sup></a>Transient messages and messages on non-durable queues are not replicated.</p></div></div></div><div class="navfooter"><hr /><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="Java-Broker-High-Availability.html">Prev</a>&#160;</td><td align="center" width="20%"><a accesskey="u" href="Java-Broker-High-Availability.html">Up</a></td><td align="right" width="40%">&#160;<a accesskey="n" href="Java-Broker-High-Availability-CreatingGroup.html">Next</a></td></tr><tr><td align="left" valign="top" width="40%">Chapter&#160;10.&#160;High Availability&#160;</td><td align="center" width="20%"><a accesskey="h" href="Apache-Qpid-Broker-J-Book.html">Home</a></td><td align="right" valign="top" width="40%">&#160;10.3.&#160;Creating a group</td></tr></table></div></div>