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 Wed, 26 May 2010 02:50: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 (9)</h4>
                                 
    
<div id="page-diffs">
            <table class="diff" cellpadding="0" cellspacing="0">
            <tr><td class="diff-changed-lines" >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 <span class="diff-changed-words">bean<span
class="diff-added-chars"style="background-color: #dfd;">(SFSB)</span></span>
as well as for stateless session <span class="diff-changed-words">bean<span class="diff-added-chars"style="background-color:
#dfd;">(SLSB)</span>.</span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" >h2. Unicast-based failover for
<span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">stateless
session bean</span> <span class="diff-added-words"style="background-color: #dfd;">SLSB</span>
<br></td></tr>
            <tr><td class="diff-changed-lines" >In addition to the session replication
support, <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">Wadi</span>
<span class="diff-added-words"style="background-color: #dfd;">WADI</span> 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-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">
<br></td></tr>
            <tr><td class="diff-unchanged" >{code:xml} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">...
<br></td></tr>
            <tr><td class="diff-unchanged" >&lt;module name=&quot;org.apache.geronimo.configs/wadi-clustering/2.2.1-SNAPSHOT/car&quot;&gt;
<br>	&lt;gbean name=&quot;DefaultBackingStrategyFactory&quot;&gt; <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >	&lt;/gbean&gt; <br>&lt;/module&gt;
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">...
<br></td></tr>
            <tr><td class="diff-unchanged" >{code} <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-added-lines" style="background-color: #dfd;">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>To enable WADI clustering for SLSB,
add openejb-clustering-wadi into the deployment plan as followed: <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">
</span> <span class="diff-added-words"style="background-color: #dfd;">{code:xml}</span>
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">&lt;ejb-jar
xmlns=&quot;http://geronimo.apache.org/xml/ns/j2ee/ejb/openejb-2.0&quot;  <br>
        xmlns:wadi=&quot;http://geronimo.apache.org/xml/ns/openejb-clustering-wadi-1.2&quot;&gt;
 <br>... <br>   &lt;wadi:openejb-clustering-wadi&gt; <br>      &lt;wadi:deltaReplication&gt;false&lt;/wadi:deltaReplication&gt;
<br>   &lt;/wadi:openejb-clustering-wadi&gt; <br>&lt;/ejb-jar&gt;
<br>{code} <br> <br>h2. Unicast-based failover for SFSB <br></td></tr>
        </table>
</div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p>OpenEJB uses multicast to support failover for session bean. However it doesn'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).</p>

<h2><a name="EJBfailover-UnicastbasedfailoverforSLSB"></a>Unicast-based
failover for SLSB</h2>
<p>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'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.</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>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.<br/>
To enable WADI clustering for SLSB, add openejb-clustering-wadi 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-UnicastbasedfailoverforSFSB"></a>Unicast-based
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=3&originalVersion=2">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