geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Geronimo v2.2 > JMS clustering in Geronimo
Date Tue, 08 Jun 2010 09:25:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1810/9/1/_/styles/combined.css?spaceKey=GMOxDOC22&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/GMOxDOC22/JMS+clustering+in+Geronimo">JMS
clustering in Geronimo</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~chirunhua@gmail.com">Runhua
Chi</a>
    </h4>
        <br/>
                         <h4>Changes (0)</h4>
                                 
    
<div id="page-diffs">
            <table class="diff" cellpadding="0" cellspacing="0">
            <tr><td class="diff-snipped" >...<br></td></tr>
        </table>
</div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <style type='text/css'>/*<![CDATA[*/
table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color:
#f0f0f0}
table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}

/*]]>*/</style><div class="Scrollbar"><table class='ScrollbarTable'><tr><td
class='ScrollbarPrevIcon'><a href="/confluence/display/GMOxDOC22/Farming+using+Deployment"><img
border='0' align='middle' src='/confluence/images/icons/back_16.gif' width='16' height='16'></a></td><td
width='33%' class='ScrollbarPrevName'><a href="/confluence/display/GMOxDOC22/Farming+using+Deployment">Farming
using Deployment</a>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a
href="/confluence/display/GMOxDOC22/Clustering+and+farming"><img border='0' align='middle'
src='/confluence/images/icons/up_16.gif' width='8' height='8'></a></sup><a
href="/confluence/display/GMOxDOC22/Clustering+and+farming">Clustering and farming</a></td><td
width='33%' class='ScrollbarNextName'>&nbsp;<a href="/confluence/display/GMOxDOC22/Plugin+based+Farming">Plugin
based Farming</a></td><td class='ScrollbarNextIcon'><a href="/confluence/display/GMOxDOC22/Plugin+based+Farming"><img
border='0' align='middle' src='/confluence/images/icons/forwd_16.gif' width='16' height='16'></a></td></tr></table></div>

<p>JMS clustering in Geronimo is handled by ActiveMQ component directly. By updating
<tt>activemq.xml</tt> file under <tt>/var/activemq/conf</tt> directory,
you can configure brokers to be clustered and a JMS request can fail over to another broker
if the JMS broker goes down using <a href="http://activemq.apache.org/masterslave.html"
title="Master Slave" class="external-link" rel="nofollow">Master Slave</a> functionality.</p>

<p>There are different kinds of Master/Slave configurations available according to ActiveMQ
documentation:</p>
<div>
<ul>
    <li><a href='#JMSclusteringinGeronimo-PureMaster%2FSlave'>Pure Master/Slave</a></li>
    <li><a href='#JMSclusteringinGeronimo-SharedFilesystem'>Shared File system</a></li>
    <li><a href='#JMSclusteringinGeronimo-JDBCMasterSlave'>JDBC Master Slave</a></li>
</ul></div>

<p>Refer to the configuration below for each scenario in Geronimo</p>

<h1><a name="JMSclusteringinGeronimo-PureMaster%2FSlave"></a>Pure Master/Slave</h1>
<p>With this scenario, you must specify the master and slave node explicitly and manually
restart a failed master</p>
<h2><a name="JMSclusteringinGeronimo-Masternode"></a>Master node</h2>
<p>On the master node, you just need to specify the current node is a master by using
<em>brokerName</em> attribute as followed.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>activemq.xml</b></div><div class="codeContent
panelContent">
<pre class="code-java">
...
&lt;broker xmlns=<span class="code-quote">"http:<span class="code-comment">//activemq.apache.org/schema/core"</span>

</span>        brokerName=<span class="code-quote">"master"</span> 
        useJmx=<span class="code-quote">"<span class="code-keyword">false</span>"</span>

        deleteAllMessagesOnStartup=<span class="code-quote">"<span class="code-keyword">true</span>"</span>

        tmpDataDirectory=<span class="code-quote">"${activemq.data}/tmp_storage"</span>

        useShutdownHook=<span class="code-quote">"<span class="code-keyword">false</span>"</span>
start=<span class="code-quote">"<span class="code-keyword">false</span>"</span>&gt;
...
</pre>
</div></div>
<h2><a name="JMSclusteringinGeronimo-Slavenode"></a>Slave node</h2>
<p>Because each master only has one slave in Pure Master/Slave scenario, the slave node
must know URI of master node and also be tagged as a slave node using <em>brokerName</em>
attribute.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>activemq.xml</b></div><div class="codeContent
panelContent">
<pre class="code-java">
...
 &lt;broker xmlns=<span class="code-quote">"http:<span class="code-comment">//activemq.apache.org/schema/core"</span>

</span>         brokerName=<span class="code-quote">"slave"</span> deleteAllMessagesOnStartup=<span
class="code-quote">"<span class="code-keyword">true</span>"</span>
         useJmx=<span class="code-quote">"<span class="code-keyword">false</span>"</span>

         masterConnectorURI=<span class="code-quote">"tcp:<span class="code-comment">//masterHostname:${${ActiveMQPort}}"</span>
</span>         tmpDataDirectory=<span class="code-quote">"${activemq.data}/tmp_storage"</span>

         useShutdownHook=<span class="code-quote">"<span class="code-keyword">false</span>"</span>
start=<span class="code-quote">"<span class="code-keyword">false</span>"</span>&gt;
...
</pre>
</div></div>
<h2><a name="JMSclusteringinGeronimo-Clientconnection"></a>Client connection</h2>
<p>JMS clients use failover:// protocol to locate brokers in a cluster such as </p>
<div class="panel" style="border-width: 1px;"><div class="panelContent">
<p>failover://(tcp://masterhost:61616,tcp://slavehost:61616)?randomize=false</p>
</div></div>


<h1><a name="JMSclusteringinGeronimo-SharedFilesystem"></a>Shared File system</h1>
<p>In this scenario, you must use a shared file system to provide high availability
of brokers and automatic discovery of master/slave nodes. The shared folder must allow different
slaves to have <em>write</em> permission.</p>
<h2><a name="JMSclusteringinGeronimo-Eachnode"></a>Each node</h2>
<p>On each node, configure a shared directory as the place where brokers are using <tt>persistenceAdapter</tt>
element as followed:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>activemq.xml</b></div><div class="codeContent
panelContent">
<pre class="code-java">
...
   &lt;persistenceAdapter&gt;
      &lt;amqPersistenceAdapter directory=<span class="code-quote">"/sharedFileSystem/sharedBrokerData"</span>/&gt;
    &lt;/persistenceAdapter&gt;
...
</pre>
</div></div>
<h2><a name="JMSclusteringinGeronimo-Clientconnection"></a>Client connection</h2>
<p>JMS clients use failover:// protocol to locate brokers in a cluster such as </p>
<div class="panel" style="border-width: 1px;"><div class="panelContent">
<p>failover://(tcp://broker1:61616,tcp://broker2:61616,tcp://broker3:61616)?randomize=false</p>
</div></div>

<h1><a name="JMSclusteringinGeronimo-JDBCMasterSlave"></a>JDBC Master Slave</h1>
<p>In this scenario, you must use a shared database as persistence enginee and automatic
recovery.</p>
<h2><a name="JMSclusteringinGeronimo-Eachnode"></a>Each node</h2>
<p>On each node, configure a shared database pool using <tt>jdbcPersistenceAdapter</tt>
element as followed, we use embeded Derby database server as an example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>activemq.xml</b></div><div class="codeContent
panelContent">
<pre class="code-java">
...
    &lt;persistenceAdapter&gt;
      &lt;amqPersistenceAdapter dataSource=<span class="code-quote">"Shared-DS"</span>/&gt;
    &lt;/persistenceAdapter&gt;
...
    &lt;bean id=<span class="code-quote">"Shared-ds"</span> class=<span
class="code-quote">"org.apache.derby.jdbc.EmbeddedDataSource"</span>&gt;
      &lt;property name=<span class="code-quote">"databaseName"</span> value=<span
class="code-quote">"Shared_db"</span>/&gt;
      &lt;property name=<span class="code-quote">"createDatabase"</span> value=<span
class="code-quote">"create"</span>/&gt;
    &lt;/bean&gt;
</pre>
</div></div>

<h2><a name="JMSclusteringinGeronimo-Clientconnection"></a>Client connection</h2>
<p>JMS clients use failover:// protocol to locate brokers in a cluster such as </p>
<div class="panel" style="border-width: 1px;"><div class="panelContent">
<p>failover://(tcp://broker1:61616,tcp://broker2:61616,tcp://broker3:61616)?randomize=false</p>
</div></div>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC22/JMS+clustering+in+Geronimo">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=21792390&revisedVersion=5&originalVersion=4">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC22/JMS+clustering+in+Geronimo?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message