0 Replies Latest reply on Apr 5, 2004 5:57 AM by Marco

    SFSB prolem during state replication in HA cluster (5)

    Marco Newbie

      ========================== ejb-jar.xml =====================================================

      <?xml version="1.0"?>

      <!DOCTYPE ejb-jar PUBLIC
      "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
      "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

      <ejb-jar>

      <enterprise-beans>


      <ejb-name>TestHAEjbStateless</ejb-name>

      it.ibm.com.it42021.test.ejb.TestHAEjbStatelessHomeRemote
      it.ibm.com.it42021.test.ejb.TestHAEjbStatelessRemote
      <ejb-class>it.ibm.com.it42021.test.ejb.TestHAEjbStatelessBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
      <security-identity><use-caller-identity/></security-identity>




      <ejb-name>TestHAEjbStateful</ejb-name>

      it.ibm.com.it42021.test.ejb.TestHAEjbStatefulHomeRemote
      it.ibm.com.it42021.test.ejb.TestHAEjbStatefulRemote
      <ejb-class>it.ibm.com.it42021.test.ejb.TestHAEjbStatefulBean</ejb-class>
      <session-type>Stateful</session-type>
      <transaction-type>Container</transaction-type>
      <security-identity><use-caller-identity/></security-identity>



      </enterprise-beans>

      </ejb-jar>
      ========================== jboss.xml =====================================================
      <?xml version="1.0"?>

      <!-- Esempio di descrittore per EJB in HA -->


      <enterprise-beans>


      <ejb-name>TestHAEjbStateless</ejb-name>
      <jndi-name>ejb/TestHAEjbStateless</jndi-name>

      true




      <ejb-name>TestHAEjbStateful</ejb-name>
      <jndi-name>ejb/TestHAEjbStateful</jndi-name>

      true

      <!-- i've tried with and without spefic infos about cluster-config -->
      <cluster-config>
      <partition-name>DefaultPartition</partition-name>
      <home-load-balance-policy>org.jboss.ha.framework.interfaces.RoundRobin</home-load-balance-policy>

      <!-- i've tried all possible combinations -->
      <bean-load-balance-policy>org.jboss.ha.framework.interfaces.RoundRobin</bean-load-balance-policy>
      <!-- bean-load-balance-policy>org.jboss.ha.framework.interfaces.FirstAvailable</bean-load-balance-policy -->
      <!-- bean-load-balance-policy>org.jboss.ha.framework.interfaces.FirstAvailableIdenticalAllProxies</bean-load-balance-policy -->

      <session-state-manager-jndi-name>/HASessionState/Default</session-state-manager-jndi-name>
      </cluster-config>



      </enterprise-beans>


      ================= cluster-service.xml (from BE1 configs, BE2 is identical) =======================================

      <?xml version="1.0" encoding="UTF-8"?>

      <!-- ===================================================================== -->
      <!-- -->
      <!-- Sample Clustering Service Configuration -->
      <!-- -->
      <!-- ===================================================================== -->





      <!-- ==================================================================== -->
      <!-- Cluster Partition: defines cluster -->
      <!-- ==================================================================== -->



      <!-- Name of the partition being built -->
      DefaultPartition
      <!-- Determine if deadlock detection is enabled -->
      False
      <!-- The JGroups protocol configuration -->


      <!-- UDP: if you have a multihomed machine,
      set the bind_addr attribute to the appropriate NIC IP address -->
      bind_addr="192.168.1.9"
      <!-- UDP: On Windows machines, because of the media sense feature
      being broken with multicast (even after disabling media sense)
      set the loopback attribute to true -->
      <UDP mcast_addr="228.1.2.3" mcast_port="45566"
      ip_ttl="64" ip_mcast="true"
      mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
      ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
      loopback="true" />
      <PING timeout="2000" num_initial_members="3"
      up_thread="true" down_thread="true" />
      <MERGE2 min_interval="5000" max_interval="10000" />
      <FD shun="true" up_thread="true" down_thread="true"
      timeout="2500" max_tries="5" />
      <VERIFY_SUSPECT timeout="3000" num_msgs="3"
      up_thread="true" down_thread="true" />
      <pbcast.NAKACK gc_lag="50" retransmit_timeout="300,600,1200,2400,4800"
      up_thread="true" down_thread="true" />
      <pbcast.STABLE desired_avg_gossip="20000"
      up_thread="true" down_thread="true" />
      <UNICAST timeout="5000" window_size="100" min_threshold="10"
      down_thread="true" />
      <FRAG frag_size="8192"
      down_thread="true" up_thread="true" />
      <pbcast.GMS join_timeout="5000" join_retry_timeout="2000"
      shun="true" print_local_addr="true" />
      <pbcast.STATE_TRANSFER up_thread="true" down_thread="true" />




      <!-- ==================================================================== -->
      <!-- HA Session State Service for SFSB -->
      <!-- ==================================================================== -->


      jboss:service=DefaultPartition
      <!-- Name of the partition to which the service is linked -->
      DefaultPartition
      <!-- JNDI name under which the service is bound -->
      /HASessionState/Default
      <!-- Max delay before cleaning unreclaimed state.
      Defaults to 30*60*1000 => 30 minutes -->
      0


      <!-- ==================================================================== -->
      <!-- HA JNDI -->
      <!-- ==================================================================== -->


      jboss:service=DefaultPartition
      <!-- Name of the partition to which the service is linked -->
      DefaultPartition
      <!-- bind address of HA JNDI RMI endpoint -->
      ${jboss.bind.address}
      <!-- RmiPort to be used by the HA-JNDI service
      once bound. 0 => auto. -->
      0
      <!-- Port on which the HA-JNDI stub is made available -->
      11100
      <!-- Backlog to be used for client-server RMI
      invocations during JNDI queries -->
      50

      <!-- Multicast Address and Group used for auto-discovery -->
      230.0.0.4
      1102

      <!-- IP Address to which should be bound: the Port, the RmiPort and
      the AutoDiscovery multicast socket. -->
      <!-- Client socket factory to be used for client-server
      RMI invocations during JNDI queries -->
      <!--attribute name="ClientSocketFactory">custom</attribute-->
      <!-- Server socket factory to be used for client-server
      RMI invocations during JNDI queries -->
      <!--attribute name="ServerSocketFactory">custom</attribute-->




      ${jboss.bind.address}
      <!--
      0
      custom
      custom
      -->


      <!-- ==================================================================== -->
      <!-- Distributed cache invalidation -->
      <!-- ==================================================================== -->


      jboss:service=DefaultPartition
      jboss.cache:service=InvalidationManager
      jboss.cache:service=InvalidationManager
      DefaultPartition
      DefaultJGBridge




      =======================================================================

      ... other useful infos ...
      ===============================================================================================
      == JBoss version
      ===============================================================================================
      ...
      09:58:41,250 INFO [Server] Starting JBoss (MX MicroKernel)...
      09:58:41,260 INFO [Server] Release ID: JBoss [WonderLand] 3.2.3 (build: CVSTag=JBoss_3_2_3 date=200311301445)
      09:58:41,260 DEBUG [Server] Using config: org.jboss.system.server.ServerConfigImpl@ecd7e
      09:58:41,260 DEBUG [Server] Server type: class org.jboss.system.server.ServerImpl
      09:58:41,260 INFO [Server] Home Dir: C:\jboss-cluster
      09:58:41,260 INFO [Server] Home URL: file:/C:/jboss-cluster/
      ...

      ===============================================================================================
      == JGroups version
      ===============================================================================================
      C:\jboss-cluster\server\backend-nodo1\lib>java -cp jgroups.jar org.jgroups.Version

      Version: 2.2.0
      CVS: $Id: Version.java,v 1.1.1.1 2003/09/09 01:24:08 belaban Exp $
      History: (see doc/history.txt for details)

      Test and demo programs works fine.

      A - java org.jgroups.demos.Draw
      B - java org.jgroups.tests.McastReceiverTest -mcast_addr 224.10.10.10 -port 5555
      java org.jgroups.tests.McastSenderTest -mcast_addr 224.10.10.10 -port 5555

      ===============================================================================================

      To execute the cluster on the same machine i've opportunely changed these files for each one of FE1, BE1 and BE2 nodes

      /<jboss-installation-directory>/server/\conf\jboss-minimal.xml
      /<jboss-installation-directory>/server/\conf\jboss-service.xml
      /<jboss-installation-directory>/server/\conf\jacorb.properties
      /<jboss-installation-directory>/server/\deploy\http-invoker.sar\META-INF\jboss-service.xml
      /<jboss-installation-directory>/server/\deploy\jbossweb-tomcat41.sar\META-INF\jboss-service.xml
      /<jboss-installation-directory>/server/\deploy\jms\oil-service.xml
      /<jboss-installation-directory>/server/\deploy\jms\oil2-service.xml
      /<jboss-installation-directory>/server/\deploy\jms\uil2-service.xml
      /<jboss-installation-directory>/server/\deploy\snmp-adaptor.sar\managers.xml
      /<jboss-installation-directory>/server/\deploy\snmp-adaptor.sar\META-INF\jboss-service.xml
      /<jboss-installation-directory>/server/\deploy\cluster-service.xml

      the changes was about ports numbers to avoid conflicts on the same machine IP.
      ===============================================================================================