6 Replies Latest reply on Oct 3, 2003 11:38 PM by pushpendra

    Session Distribution AND Session Affinity

    rcostanzo

      Has anybody out there gotten a JBoss configuration to work with BOTH session distribution (replicated sessions) and session affinity (sticky sessions)?

      It looks like the Jetty DistributableSessionManager currently only supports one or the other.

      My application needs to have both session failover and sticky sessions (for cache-hit efficiency). Is there a configuration that can do this?

      I'm running JBoss 3.2.1 with Jetty (using the JGStore replication), but would be willing to switch to Tomcat if necessary.

        • 1. Re: Session Distribution AND Session Affinity
          slaboure

          I've been able to do so with both Jetty (both implementation), tomcat . Show you mod_jk2 config file.

          cheers,


          sacha

          • 2. Re: Session Distribution AND Session Affinity
            dcartier

            Hi,

            I have a 4 node cluster running with JBoss 3.0.7 w/ Tomcat that supports session distribution and session affinity.

            I struggled with Jetty around the 3.0.1 - 3.0.3 version to get it to work, but eventually gave up and used the
            Tomcat version and it has worked fine ever since.

            To get this to work, under Tomcat, just mark your app distributable, add a unique JVMroute to each coyote definition and configure JK to use sticky sessions.

            I know Jules was working towards getting Jetty to support this but I am not sure how far long he is with it.

            Dennis

            • 3. Re: Session Distribution AND Session Affinity
              rcostanzo

              My workers2.properties is posted below. www3 and www4 are boxes with 2 instances running each. With this current configuration, the same session's requests will be evenly balanced across all 4 instances rather than sticking to just one. My web applications are marked as and I'm using Jetty's JGStore for session replication.

              [logger]
              level=DEBUG

              [config:]
              file=/etc/httpd/conf/workers2.properties
              debug=0
              debugEnv=0

              [uriMap:]
              info=Maps the requests. Options: debug
              debug=0

              [shm:]
              info=Scoreboard. Required for reconfiguration and status with multiprocess servers
              file=/etc/httpd/logs/jk2.shm
              size=1000000
              debug=0
              disabled=0

              [workerEnv:]
              info=Global server options
              timing=1
              debug=0

              [lb:lb]
              info=Default load balancer.
              debug=1

              [channel.socket:www4:8009]
              info=srv1
              debug=0
              lb_factor=1
              group=lb
              disabled=0

              [channel.socket:www4:18009]
              info=srv2
              debug=0
              lb_factor=1
              group=lb
              disabled=0

              [channel.socket:www3:8009]
              info=srv3
              debug=0
              lb_factor=1
              group=lb
              disabled=0

              [channel.socket:www3:18009]
              info=srv4
              debug=0
              lb_factor=1
              group=lb
              disabled=0

              [status:]
              info=Status worker, displays runtime informations

              [uri:/jkstatus/*]
              info=Display status information and checks the config file for changes.
              group=status:
              debug=0

              [uri:/PSP-V2/*]
              info=Web app
              context=/PSP-V2
              group=lb
              debug=0

              [uri:/admin/*]
              info=Admin app
              context=/admin
              group=lb
              debug=0


              FYI, here is my post to the Jetty list. Interesting that you've gotten it to work because Jules doesn't think it should be able to.

              >Jules,
              >
              >Below you say:
              >"You currently have to choose EITHER session affinity OR distribution
              >NOT both - the DistributableSessionManager does not yet support
              >affinity."
              >
              >I want session distribution for failover support. However, session
              >affinity is also import for my app server (JBoss) to use entity EJB
              >caching efficiently (i.e. the ConsumerEJB is only cached on the
              >instance you're "stuck" to rather than on every instance). You used
              >the word "yet" above implying that the DistributableSessionManager
              >will suport both of these features in the future. Is there any kind
              >of timetable for this? Thanks.
              >
              >
              Good point.

              I will start on a major reiteration of this code in about 6 weeks - as
              soon as my current contract ends. Cobining these two features will be a
              priority.

              Jules

              • 4. Re: Session Distribution AND Session Affinity
                slaboure

                This is the (only) file that is interesting...:

                /etc/httpd/conf/workers2.properties

                • 5. Re: Session Distribution AND Session Affinity
                  vitaliy

                  Please, could you show us your workers2.properties?

                  The one that supports boath Session Distribution AND Session Affinity.

                  Thank you,
                  Vitaliy.

                  • 6. Re: Session Distribution AND Session Affinity
                    pushpendra

                    Can anybody check my workers2.properties file.

                    Pushpendra