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

    JBoss 6 HttpSession clustering

    dphan3003

      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

        • 1. JBoss 6 HttpSession clustering
          dphan3003

          Any help plzzz?

          • 2. JBoss 6 HttpSession clustering
            nickarls

            I've done pretty much no clustering but I'll give it a stab anyway ;-)

             

            I think you need some sort of front controller for both servers, I don't think you can test them by just going to both addresses and see what is set in the session and what not because the sessions are different.

            • 3. JBoss 6 HttpSession clustering
              dphan3003

              Thank for joining my discussion Nicklas, give me a reason to keep this alive.

               

              I dont agree with front controller you suggest. It does kill the whole concept of clustering

               

              http://docs.jboss.org/jbossas/docs/Clustering_Guide/beta422/html/

               

              I know my testing webapp is not the best ( probably not right) one but I could not find any test for this. There is only EJB example available but unfortunately, we dont use EJB.

               

              I took a further step by applied the configuration of web.xml and jboss-web.xml to admin-console.war file and list of exception comes up.

               

              I wish for any input from JBoss developer.

              • 4. JBoss 6 HttpSession clustering
                shelly.mcgowan

                Infinispan replaced JBoss Cache in JBoss AS 6.  Refer to the Infinispan in AS 6 wiki which includes information on Distributed Web Sessions instead of the document you reference above.

                • 5. Re: JBoss 6 HttpSession clustering
                  ssamayoagt

                  I just getting my feet wet with JBoss clustering.

                   

                  As I understand any bean I want to put in session context and been replicated to other nodes must be annotated with @Replicatable, isnt?

                  Thats fine if it is own application but if I have only WAR file?

                  I mean, I dont have the source code but I want to replicate session data.

                  Is a way to "announce" the classes to be replicated in a xml file or alike?

                  Same with SLSB and SFSB.

                   

                  Thanks.

                  • 6. Re: JBoss 6 HttpSession clustering
                    dphan3003

                    I do see we all have limit experience on clustering in JBoss. Load balancing seems easy but we dont get high avail without session clustering.

                     

                    @Sergio Samayoa: as per example, I guess annotation is only needed for EJB but I may be wrong.

                     

                    @Shelly: Thank for your info. But forgive for my limitation, I cant seem to get any clustering working.

                     

                    With the above example, it would be helpful for us if you can show  details what steps we need to take to set up an simple Http Session clustering ?

                     

                    Thanks

                    • 7. Re: JBoss 6 HttpSession clustering
                      listener

                      Hi Duy Phan,

                       

                      Greetings

                       

                      I am new to jboss, also eager to learn about jboss clustering. Did you finish the HTTP session clustering? Pls provide me if you have any document for jboss clustering with or without mod_jk

                       

                      we are using Jboss 4.0.5 GA and 5

                       

                      Thanks in Advance

                       

                      Vetri