3 Replies Latest reply on May 18, 2009 9:38 AM by Suresh Reddy

    Session replication with sticky session

    Suresh Reddy Newbie

      Hi,

      I could setup JBoss cluster with 2 nodes with apache/mod_jk as front-end.
      I did enabled the sticky session in mod_jk configuration.

      PS: I'm using Jboss-4.2.3.GA

      Now, the problem is with session replication. I couldn;t get the session replicated on one node failure.
      I added tag to web.xml
      and I added the following in jboss-web.xml
      <jboss-web>
      <replication-config>
      <replication-trigger>SET_AND_NON_PRIMITIVE_GET</replication-trigger>
      <replication-granularity>SESSION</replication-granularity>
      </replication-config>
      </jboss-web>

      Also, I enabled...
      "jvmRoute" and "UseJK" for both the nodes.

      When I remove the sticky session then, teh session is replicated properly on both the nodes.

      Any pointers would be highly appreciated.

      Thanks,
      Suresh

        • 1. Re: Session replication with sticky session
          Sushant Gulati Newbie

          Hi Suresh,

          I've been trying the same thing over. I think removing sticky session attribute in your workers.properties file makes the http request independent of the node it earlier went to.If you already have session replication implemented, then this should work fine.

          Although I've been having problem implementing session replication in any way. My cluster instances work fine independently, nodes discover each other and understand that they are clustered. But I need some help regarding HTTP session state replication.

          Can you please let me know if you are using a EJB based application or a simple war file?

          Regards,
          Sushant

          • 2. Re: Session replication with sticky session
            Suresh Reddy Newbie

            Hi Sushant,

            The problem I'm facing is;
            when I enable sticky session (in workers. properties) then session replication doesn;t work as expected.
            i.e., when I shutdown "node1" (all the requests are going to this node till now0 then, the next request from browser (thru apache/mod_jk) fos to "node2" but, the code which tries to read session data was set by "node1" is null.
            eg: I stored username/pwd (on login) in session (thru node1) but, when I try to retrieve the same data from node2.... returns null.

            My understanding is: when we enable session stickiness; the session data might be cached at "node1" (may be for better perf.).. and the same is tied to "node1" forever. I'm not sure on this.. I may be wrong. I'm stuck at this point now.

            session stickiness works fine for me.
            Also, when I disable session stickiness, session replication works fine i.e., the requests are going to random nodes with full session data.

            Thanks,
            Suresh

            • 3. Re: Session replication with sticky session
              Suresh Reddy Newbie

              Help please!!!

              I'm badly stuck at this point.

              Thanks,
              Suresh