7 Replies Latest reply on Feb 19, 2011 9:47 AM by listener it

    JBoss 6 HttpSession clustering

    Duy Phan Newbie

      Hi all,

       

      I am so new to JBoss clustering and trying to set up an Stateful cluster of 2 nodes. The cluster seems to up with 2 members but my Http Session repl does not work. Here are what steps I have done and achieve so far:

       

      1. Copy the whole server/all folder to node1 and node2 ( everything is standard).

       

      2. Start those nodes:

                run -c node1 -b 10.0.3.152 -Djboss.messaging.ServerPeerID=1 -Djgroups.bind_addr=127.0.0.1

                run -c node2 -b 169.254.90.246 -Djboss.messaging.ServerPeerID=2 -Djgroups.bind_addr=127.0.0.1

       

      3. The cluster is up. [CoreGroupCommunicationService] Number of cluster members: 2 and I can see them via JMX console - HAPartition

       

      4. My testing Webapp has the following structure:

                         web.xml:

       

                                     <distributable/>

       

                         jboss-web.xml:

       

       

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

       

      <jboss-web>

          <replication-config>

              <replication-trigger>SET_AND_NON_PRIMITIVE_GET</replication-trigger>

              <replication-granularity>SESSION</replication-granularity>

          </replication-config>

      </jboss-web>

       

       

                     index.jsp:

       

       

      <%

          String test=(String)session.getAttribute("name");

       

          if(test!=null)

          {

              out.println("Test is set is "+test);

              session.setAttribute("name",null);

          }

          else

          {

              out.println("Test is  not set");

          }

       

      %>

       

                set.jsp:

       

      <%

          String test=(String)session.getAttribute("name");

       

          if(test==null)

          {

              session.setAttribute("name",new String("JBoss"));

          }       

       

       

      %>

       

      5. I start Webapp in 2 bind address. Tried to use set.jsp in one node and access index.jsp in other node, but it does not work. I found some guide using JMX Mbean of Tomcat Cache to monitor but it should have been replaced by something else in 6

       

       

       

      **Note: I dont set up Load Balancer using mod_jk yet since I guess it does not matter.

       

      Thank a lot for any help