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 > EJB failover
Date Thu, 27 May 2010 08:43:00 GMT
<html>
<head>
    <base href="http://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="http://cwiki.apache.org/confluence/display/GMOxDOC22/EJB+failover">EJB
failover</a></h2>
    <h4>Page <b>edited</b> by             <a href="http://cwiki.apache.org/confluence/display/~carol%2Bh">Di
Hu</a>
    </h4>
        <br/>
                         <h4>Changes (7)</h4>
                                 
    
<div id="page-diffs">
            <table class="diff" cellpadding="0" cellspacing="0">
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">OpenEJB
uses *multicast* to support failover for session bean. However it doesn&#39;t provide
session replication for stateful session bean. Geronimo uses WADI to add a session replication
for stateful session bean so that Geronimo can support failover for stateful session bean(SFSB)
as well as for stateless session bean(SLSB). <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">OpenEJB,
the container Geronimo uses for providing EJB services, does not provide session replication
for stateful session bean. Geronimo uses WADI to add a session replication for stateful session
bean so that Geronimo can support failover for stateful session bean(SFSB) as well as for
stateless session bean(SLSB). <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h2.
Enabling failover support for SFSB  <br> <br>Geronimo now has some basic support
for SFSB clustering such as state replication between cluster members. The Geronimo-specific
deployment plan for an EJB application, which is usually packaged as an EJB JAR file, is called
*&quot;openejb-jar.xml&quot;*. The *openejb-jar.xml* deployment plan is used to in
conjunction with the *ejb-jar.xml* Java EE deployment plan to deploy enterprise applications
to the Geronimo application server.  <br> <br>To enable WADI clustering to support
failover for SFSB, add _openejb-clustering-wadi_ into the deployment plan as followed: <br>{code:xml}
<br>&lt;openejb-jar xmlns=&quot;http://openejb.apache.org/xml/ns/openejb-jar-2.2&quot;
 <br>             xmlns:sys=&quot;http://geronimo.apache.org/xml/ns/deployment-1.2&quot;&gt;
 <br>... <br>  &lt;openejb-clustering-wadi/&gt; <br>&lt;/openejb-jar&gt;
<br>{code} <br> <br>The following server configurations, shipped out-of-the-box
with the JEE5 assemblies, must be installed for clustering to work: <br>* _org.apache.geronimo.configs/openejb-clustering-wadi//car_:
it defines runtime dependencies and OpenEJB clustering contracts. <br>* _org.apache.geronimo.configs/openejb-clustering-builder-wadi//car_:
it defines deployment time dependencies along with a _OpenEJBClusteringBuilder_ GBean declaring
the default clustering configuration. <br>This configuration must be running when a
clustered SFSB is started. If it is not, then the substitution group _openejb-clustering-wadi_
is not properly recognized and the deployment fails. <br> <br></td></tr>
            <tr><td class="diff-unchanged" >h2. Enabling unicast failover for
SLSB <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">In
addition to the session replication support, WADI can also be configured to use unicast instead
of multicast to support failover for stateless session bean. To enable unicast-based failover
for stateless session bean, the wadi-clustering module in GERONIMO_HOME\var\config\config.xml
should be configured for each server node. Each static member has it&#39;s own gbean configuration
in the wadi-cluster module in config.xml. Ensure that you define all the static members in
it. The following example shows the configuration with two static members. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">As
of Geronimo V2.1, it requires *multicast* for failover scenarios. Basically the server cluster
members maintain membership information using multicast heartbeats and the ejb client maintains
a list of servers to change target server based on availability. Each multicast packet contains
a single URI that advertises a service, its group, and its location in the form of &quot;cluster1:ejb:ejbd://thehost:4201&quot;.
 <br> <br>However, users fail to use multicast in certain environments. Starting
from Geronimo V2.2, *unicast-based* support is provided. WADI can be configured to use unicast
instead of multicast to support failover for stateless session bean. To enable unicast-based
failover for stateless session bean, the {{wadi-clustering}} module in {{&lt;GERONIMO_HOME&gt;/var/config/config.xml}}
should be configured for each server node. Each static member has its own gbean configuration
in the {{wadi-cluster}} module in {{config.xml}}. Ensure that you define all the static members
in it. The following example shows the configuration with two static members. <br></td></tr>
            <tr><td class="diff-unchanged" >{code:xml} <br>... <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >_Node2_IP_ is the IP address of the
second server node.  <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">The
Geronimo-specific deployment plan for an EJB application, which is usually packaged as an
EJB JAR file, is called *&quot;openejb-jar.xml&quot;*. The *openejb-jar.xml* deployment
plan is used to in conjunction with the *ejb-jar.xml* Java EE deployment plan to deploy enterprise
applications to the Geronimo application server. <br></td></tr>
            <tr><td class="diff-changed-lines" >To enable WADI <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">clustering</span>
<span class="diff-added-words"style="background-color: #dfd;">configuration</span>
for SLSB, add <span class="diff-changed-words"><span class="diff-added-chars"style="background-color:
#dfd;">{{</span>openejb-clustering-wadi<span class="diff-added-chars"style="background-color:
#dfd;">}}</span></span> into the deployment plan as followed: <br></td></tr>
            <tr><td class="diff-unchanged" >{code:xml} <br>&lt;ejb-jar
xmlns=&quot;http://geronimo.apache.org/xml/ns/j2ee/ejb/openejb-2.0&quot;  <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
        </table>
</div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p>OpenEJB, the container Geronimo uses for providing EJB services, does not
provide session replication for stateful session bean. Geronimo uses WADI to add a session
replication for stateful session bean so that Geronimo can support failover for stateful session
bean(SFSB) as well as for stateless session bean(SLSB).</p>

<h2><a name="EJBfailover-EnablingfailoversupportforSFSB"></a>Enabling failover
support for SFSB </h2>

<p>Geronimo now has some basic support for SFSB clustering such as state replication
between cluster members. The Geronimo-specific deployment plan for an EJB application, which
is usually packaged as an EJB JAR file, is called <b>"openejb-jar.xml"</b>. The
<b>openejb-jar.xml</b> deployment plan is used to in conjunction with the <b>ejb-jar.xml</b>
Java EE deployment plan to deploy enterprise applications to the Geronimo application server.
</p>

<p>To enable WADI clustering to support failover for SFSB, add <em>openejb-clustering-wadi</em>
into the deployment plan as followed:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
&lt;openejb-jar xmlns=<span class="code-quote">"http://openejb.apache.org/xml/ns/openejb-jar-2.2"</span>

             <span class="code-keyword">xmlns:sys</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/deployment-1.2"</span>&gt;

...
  <span class="code-tag">&lt;openejb-clustering-wadi/&gt;</span>
<span class="code-tag">&lt;/openejb-jar&gt;</span>
</pre>
</div></div>

<p>The following server configurations, shipped out-of-the-box with the JEE5 assemblies,
must be installed for clustering to work:</p>
<ul>
	<li><em>org.apache.geronimo.configs/openejb-clustering-wadi//car</em>:
it defines runtime dependencies and OpenEJB clustering contracts.</li>
	<li><em>org.apache.geronimo.configs/openejb-clustering-builder-wadi//car</em>:
it defines deployment time dependencies along with a <em>OpenEJBClusteringBuilder</em>
GBean declaring the default clustering configuration.<br/>
This configuration must be running when a clustered SFSB is started. If it is not, then the
substitution group <em>openejb-clustering-wadi</em> is not properly recognized
and the deployment fails.</li>
</ul>


<h2><a name="EJBfailover-EnablingunicastfailoverforSLSB"></a>Enabling unicast
failover for SLSB</h2>
<p>As of Geronimo V2.1, it requires <b>multicast</b> for failover scenarios.
Basically the server cluster members maintain membership information using multicast heartbeats
and the ejb client maintains a list of servers to change target server based on availability.
Each multicast packet contains a single URI that advertises a service, its group, and its
location in the form of "cluster1:ejb:ejbd://thehost:4201". </p>

<p>However, users fail to use multicast in certain environments. Starting from Geronimo
V2.2, <b>unicast-based</b> support is provided. WADI can be configured to use
unicast instead of multicast to support failover for stateless session bean. To enable unicast-based
failover for stateless session bean, the <tt>wadi-clustering</tt> module in <tt>&lt;GERONIMO_HOME&gt;/var/config/config.xml</tt>
should be configured for each server node. Each static member has its own gbean configuration
in the <tt>wadi-cluster</tt> module in <tt>config.xml</tt>. Ensure
that you define all the static members in it. The following example shows the configuration
with two static members.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
...
<span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/wadi-clustering/2.2.1-SNAPSHOT/car"</span>&gt;</span>
	<span class="code-tag">&lt;gbean name=<span class="code-quote">"DefaultBackingStrategyFactory"</span>&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"nbReplica"</span>&gt;</span>${ReplicaCount}<span
class="code-tag">&lt;/attribute&gt;</span>
	<span class="code-tag">&lt;/gbean&gt;</span>
	<span class="code-tag">&lt;gbean name=<span class="code-quote">"DefaultDispatcherHolder"</span>&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"disableMCastService"</span>&gt;</span>true<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"receiverPort"</span>&gt;</span>4002<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"endPointURI"</span>&gt;</span>${EndPointURI}<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"clusterName"</span>&gt;</span>${WADIClusterName}<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;reference name=<span class="code-quote">"staticMember"</span>&gt;</span>
			<span class="code-tag">&lt;pattern&gt;</span>
				<span class="code-tag">&lt;groupId&gt;</span>org.apache.geronimo.configs<span
class="code-tag">&lt;/groupId&gt;</span>
				<span class="code-tag">&lt;artifactId&gt;</span>wadi-clustering<span
class="code-tag">&lt;/artifactId&gt;</span>
				<span class="code-tag">&lt;version&gt;</span>2.2.1-SNAPSHOT<span
class="code-tag">&lt;/version&gt;</span>
				<span class="code-tag">&lt;type&gt;</span>car<span class="code-tag">&lt;/type&gt;</span>
				<span class="code-tag">&lt;name&gt;</span>firstStaticMember<span
class="code-tag">&lt;/name&gt;</span>
			<span class="code-tag">&lt;/pattern&gt;</span>
		<span class="code-tag">&lt;/reference&gt;</span>
	<span class="code-tag">&lt;/gbean&gt;</span>
	&lt;gbean
		name=<span class="code-quote">"org.apache.geronimo.configs/wadi-clustering/2.2.1-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/wadi-clustering/2.2.1-SNAPSHOT/car,j2eeType=GBean,name=firstStaticMember"</span>
		gbeanInfo=<span class="code-quote">"org.apache.geronimo.clustering.wadi.WadiStaticMember"</span>&gt;
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"className"</span>&gt;</span>org.apache.catalina.tribes.membership.StaticMember<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"port"</span>&gt;</span>4002<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"securePort"</span>&gt;</span>-1<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"domain"</span>&gt;</span>test-domain<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"UniqueId"</span>&gt;</span>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"host"</span>&gt;</span>Node1_IP<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;reference name=<span class="code-quote">"nextWadiStaticMember"</span>&gt;</span>
			<span class="code-tag">&lt;pattern&gt;</span>
				<span class="code-tag">&lt;groupId&gt;</span>org.apache.geronimo.configs<span
class="code-tag">&lt;/groupId&gt;</span>
				<span class="code-tag">&lt;artifactId&gt;</span>wadi-clustering<span
class="code-tag">&lt;/artifactId&gt;</span>
				<span class="code-tag">&lt;version&gt;</span>2.2.1-SNAPSHOT<span
class="code-tag">&lt;/version&gt;</span>
				<span class="code-tag">&lt;type&gt;</span>car<span class="code-tag">&lt;/type&gt;</span>
				<span class="code-tag">&lt;name&gt;</span>secondStaticMember<span
class="code-tag">&lt;/name&gt;</span>
			<span class="code-tag">&lt;/pattern&gt;</span>
		<span class="code-tag">&lt;/reference&gt;</span>
	<span class="code-tag">&lt;/gbean&gt;</span>
	&lt;gbean
		name=<span class="code-quote">"org.apache.geronimo.configs/wadi-clustering/2.2.1-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/wadi-clustering/2.2.1-SNAPSHOT/car,j2eeType=GBean,name=secondStaticMember"</span>
		gbeanInfo=<span class="code-quote">"org.apache.geronimo.clustering.wadi.WadiStaticMember"</span>&gt;
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"className"</span>&gt;</span>org.apache.catalina.tribes.membership.StaticMember<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"port"</span>&gt;</span>4003<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"securePort"</span>&gt;</span>-1<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"domain"</span>&gt;</span>test-domain<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"UniqueId"</span>&gt;</span>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"host"</span>&gt;</span>Node2_IP<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;reference name=<span class="code-quote">"nextWadiStaticMember"</span>
/&gt;</span>
	<span class="code-tag">&lt;/gbean&gt;</span>
<span class="code-tag">&lt;/module&gt;</span>
...
</pre>
</div></div>

<p>where</p>

<p><em>Node1_IP</em> is the IP address of the first server node.<br/>
<em>Node2_IP</em> is the IP address of the second server node. </p>

<p>To enable WADI configuration for SLSB, add <tt>openejb-clustering-wadi</tt>
into the deployment plan as followed:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
&lt;ejb-jar xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/j2ee/ejb/openejb-2.0"</span>

         <span class="code-keyword">xmlns:wadi</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/openejb-clustering-wadi-1.2"</span>&gt;

...
   <span class="code-tag">&lt;wadi:openejb-clustering-wadi&gt;</span>
      <span class="code-tag">&lt;wadi:deltaReplication&gt;</span>false<span
class="code-tag">&lt;/wadi:deltaReplication&gt;</span>
   <span class="code-tag">&lt;/wadi:openejb-clustering-wadi&gt;</span>
<span class="code-tag">&lt;/ejb-jar&gt;</span>
</pre>
</div></div>

<h2><a name="EJBfailover-EnablingunicastfailoverforSFSB"></a>Enabling unicast
failover for SFSB</h2>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="http://cwiki.apache.org/confluence/display/GMOxDOC22/EJB+failover">View
Online</a>
        |
        <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=21791056&revisedVersion=5&originalVersion=4">View
Changes</a>
                |
        <a href="http://cwiki.apache.org/confluence/display/GMOxDOC22/EJB+failover?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message