User: slaboure Date: 01/11/15 05:50:45 Added: src/xdocs/howto howtoclustering.xml Log: Added quick and simple clustering howto Revision Changes Path 1.1 manual/src/xdocs/howto/howtoclustering.xml Index: howtoclustering.xml =================================================================== <section id="clustering" lang="en"> <title>Clustering in JBoss 3.0 alpha</title> <para>Authors: <author> <firstname>Sacha</firstname> <surname>Labourey</surname> </author> <email>[EMAIL PROTECTED]</email> <author> <firstname>Bill</firstname> <surname>Burke</surname> </author> <email>[EMAIL PROTECTED]</email> </para> <section> <title>Introduction</title> <section> <title>What this article is about</title> <para>This document introduces basic clustering setup for Entity Beans, Stateful Session Beans and Stateless Session Beans. More advanced documentation is available in the main documentation (book).</para> <para>Clustering should be considered in alpha state. Feedback is highly welcome.</para> <para>Clustering is built on top of the <ulink url = "http://www.javagroups.com/">JavaGroups</ulink> framework and requires JDK 1.3.x.</para> <para>In order to create a cluster of JBoss nodes, you simply need to launch several JBoss (with clustering activated, see below) instances on different hosts. JBoss instances will automatically detect their neighbors and form a cluster.</para> </section> </section> <section> <title>General setup</title> <section> <para>Clustering features are available in the pre 3.0 sources. First get the latest sources from CVS or download one of the sources daily snapshot. You then need to build JBoss server (run jboss-all/build/build.bat or jboss-all/build/build.sh). For more information read this <xref linkend="intro.examples.source"/>. </para> <para>The resulting JBoss server can be found in jboss-all/build/output/jboss-3.0.0alpha.</para> <para>To activate global clustering support, you need to copy the file jboss-all/cluster/etc/cluster-service.xml in the /deploy directory of your newly built JBoss server. Clustering is now activated in your JBoss server.</para> </section> </section> <section> <title>Stateless Session Beans</title> <section> <para>To make a Stateless Session Bean (SLSB) active in a cluster, you need to modify its deployment settings in jboss.xml:</para> <para><programlisting><![CDATA[ <jboss> <enterprise-beans> <session> <ejb-name>nextgen.StatelessSession</ejb-name> <jndi-name>nextget.StatelessSession</jndi-name> <clustered>True</clustered> </session> </enterprise-beans> </jboss> ]]></programlisting></para> <para>Thus, you simply need to add the <clustered> tag to your existing jboss.xml configuration file.</para> </section> </section> <section> <title>Stateful Session Beans</title> <section> <para>To make a Stateful Session Bean (SFSB) active in a cluster, you need to modify its deployment settings in jboss.xml:</para> <para><programlisting><![CDATA[ <jboss> <enterprise-beans> <session> <ejb-name>nextgen.StatefulSession</ejb-name> <jndi-name>nextget.StatefulSession</jndi-name> <clustered>True</clustered> </session> </enterprise-beans> </jboss> ]]></programlisting></para> <para>Thus, like for SLSB, you simply need to add the <clustered> tag to your existing jboss.xml configuration file. By default, bean state is replicated in-memory in sub-groups of two nodes.</para> </section> </section> <section> <title>Entity Beans</title> <section> <para>To make an Entity Bean (EB) active in a cluster, you need to modify its deployment settings in jboss.xml:</para> <para><programlisting><![CDATA[ <jboss> <enterprise-beans> <entity> <ejb-name>nextgen.EnterpriseEntity</ejb-name> <jndi-name>nextget.EnterpriseEntity</jndi-name> <clustered>True</clustered> </entity> </enterprise-beans> </jboss> ]]></programlisting></para> <para>Thus, like for SLSB and SFSB, you simply need to add the <clustered> tag to your existing jboss.xml configuration file. By default, bean state is replicated in-memory in sub-groups of two nodes.</para> <para>As Entity Beans clustering in JBoss is based on pessimistic locking at the database level, your database must support SQL instruction like "SELECT ... FOR UPDATE". Check in your database documentation if it supports such a feature.</para> <para>Note: Entity Beans clustering has currently only been tested with Oracle.</para> </section> </section> <section> <title>JNDI and HA-JNDI</title> <section> <para>By default, client code use the standard JBoss JNDI provider: JNP.</para> <para>Nevertheless, a Highly Available (HA) JNDI server can also be used. To use it, you must have a list of cluster nodes in the provider URL list separated by commas (HA-JNDI default port is 1100): <programlisting>java.naming.provider.url=server1:1100,server2:1100,server3:1100</programlisting></para> <para>Note that automatic discovery of HA-JNDI host is not yet available but is a planned feature.</para> </section> </section> </section>
_______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development