0 Replies Latest reply on Sep 14, 2010 7:54 AM by Siddharth Shah

    Sticky session not working

    Siddharth Shah Newbie

      I am trying to create mod_cluster with stickysession.for that i changed /etc/apache2/httpd.conf
      LoadModule proxy_module modules/mod_proxy.so
      LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
      LoadModule slotmem_module modules/mod_slotmem.so
      LoadModule manager_module modules/mod_manager.so
      LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
      LoadModule advertise_module modules/mod_advertise.so
      ErrorLog /etc/apache2/logs/error_log
      LogLevel Info
      Listen 8000
      <VirtualHost *:8000>
      <Directory />
        Order deny,allow
         Allow from all
      </Directory>
      KeepAliveTimeout 60
      MaxKeepAliveRequests 0
      ManagerBalancerName mycluster
      ServerAdvertise On
      <Location /mod_cluster-manager>
      SetHandler mod_cluster-manager
      Order deny,allow
      Allow from all
      </Location>
      <Proxy balancer://mycluster>
         Order deny,allow
         Allow from all
        BalancerMember ajp://127.0.0.1:8009/jbossTest loadfactor=50 timeout=30
        BalancerMember ajp://127.0.0.1:8109/jbossTest loadfactor=50 timeout=30
      </Proxy>
      ProxyPass /jbossTest balancer://mycluster/ stickysession=JSESSIONID|jsessionid scolonpathdelim=on
      ProxyPassReverse /jbossTest balancer://mycluster/ stickysession=JSESSIONID|jsessionid
      </VirtualHost>
      About application server Jboss5 Configuration
      /etc/jboss-5.1.0.GA/server/node02/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <deployment xmlns="urn:jboss:bean-deployer:2.0">
      <bean name="ModClusterListener" class="org.jboss.modcluster.catalina.CatalinaEventHandlerAdapter" advertise="true">
         <constructor>
           <parameter class="org.jboss.modcluster.ContainerEventHandler"><inject bean="ModClusterService"/></parameter>
           <parameter class="javax.management.MBeanServer"><inject bean="JMXKernel" property="mbeanServer"/></parameter>
         </constructor>
         <depends>WebServer</depends>
      </bean>
      <bean name="ModClusterService" class="org.jboss.modcluster.ModClusterService" mode="On Demand">
         <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster",exposedInterface=org.jboss.modcluster.ModClusterServiceMBean.class)</annotation>
         <constructor>
           <parameter class="org.jboss.modcluster.config.ModClusterConfig"><inject bean="ModClusterConfig"/></parameter>
           <parameter class="org.jboss.modcluster.load.LoadBalanceFactorProvider"><inject bean="DynamicLoadBalanceFactorProvider"/></parameter>
         </constructor>
      </bean>
      <bean name="ModClusterConfig" class="org.jboss.modcluster.config.ModClusterConfig" mode="On Demand">
         <property name="proxyList">${jboss.mod_cluster.proxyList:}</property>
         <property name="advertise">true</property>
         <property name="advertiseGroupAddress">${jboss.mod_cluster.advertise.address,jboss.partition.udpGroup:224.0.1.105}</property>
         <property name="advertisePort">${jboss.mod_cluster.advertise.port:23364}</property>
         <property name="excludedContexts">${jboss.mod_cluster.excludedContexts:ROOT,admin-console,invoker,jbossws,jmx-console,juddi,web-console}</property>
         <property name="autoEnableContexts">${jboss.mod_cluster.autoEnableContexts:true}</property>
         <property name="ssl">false</property>
         <property name="stickySession">true</property>
         <property name="stickySessionForce">false</property>
         <property name="stickySessionRemove">false</property>
         <property name="maxAttempts">1</property>
         <property name="workerTimeout">-1</property>
      </bean>
      ........................................
      ....................................
      Still sticky session is not working , session created from nodeA , further request can be post to modeB even jsessionid is attached in request header
      Any configutation wrong or missed ?

      I am trying to create mod_cluster with stickysession.for that i changed httpd.conf

       

      LoadModule proxy_module modules/mod_proxy.so

      LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

      LoadModule slotmem_module modules/mod_slotmem.so

      LoadModule manager_module modules/mod_manager.so

      LoadModule proxy_cluster_module modules/mod_proxy_cluster.so

      LoadModule advertise_module modules/mod_advertise.so

       

      ErrorLog /etc/apache2/logs/error_log

      LogLevel Info

       

      Listen 8000

      <VirtualHost *:8000>

       

        <Directory />

         Order deny,allow

          Allow from all

        </Directory>

       

      KeepAliveTimeout 60

      MaxKeepAliveRequests 0

       

      ManagerBalancerName mycluster

      ServerAdvertise On

       

      <Location /mod_cluster-manager>

      SetHandler mod_cluster-manager

      Order deny,allow

      Allow from all

      </Location>

       

      <Proxy balancer://mycluster>

          Order deny,allow

          Allow from all

         BalancerMember ajp://127.0.0.1:8009/jbossTest loadfactor=50 timeout=30

         BalancerMember ajp://127.0.0.1:8109/jbossTest loadfactor=50 timeout=30

      </Proxy>

       

      ProxyPass /jbossTest balancer://mycluster/ stickysession=JSESSIONID|jsessionid scolonpathdelim=on

      ProxyPassReverse /jbossTest balancer://mycluster/ stickysession=JSESSIONID|jsessionid

      </VirtualHost>

       

      About application server Jboss5 Configuration

      /etc/jboss-5.1.0.GA/server/node02/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml

       

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

      <deployment xmlns="urn:jboss:bean-deployer:2.0">

      <bean name="ModClusterListener" class="org.jboss.modcluster.catalina.CatalinaEventHandlerAdapter" advertise="true">

          <constructor>

            <parameter class="org.jboss.modcluster.ContainerEventHandler"><inject bean="ModClusterService"/></parameter>

            <parameter class="javax.management.MBeanServer"><inject bean="JMXKernel" property="mbeanServer"/></parameter>

          </constructor>

          <depends>WebServer</depends>

        </bean>

       

       

        <bean name="ModClusterService" class="org.jboss.modcluster.ModClusterService" mode="On Demand">

          <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster",exposedInterface=org.jboss.modcluster.ModClusterServiceMBean.class)</annotation>

          <constructor>

            <parameter class="org.jboss.modcluster.config.ModClusterConfig"><inject bean="ModClusterConfig"/></parameter>

            <parameter class="org.jboss.modcluster.load.LoadBalanceFactorProvider"><inject bean="DynamicLoadBalanceFactorProvider"/></parameter>

          </constructor>

        </bean>

      <bean name="ModClusterConfig" class="org.jboss.modcluster.config.ModClusterConfig" mode="On Demand">

          <property name="proxyList">${jboss.mod_cluster.proxyList:}</property>

          <property name="advertise">true</property>

          <property name="advertiseGroupAddress">${jboss.mod_cluster.advertise.address,jboss.partition.udpGroup:224.0.1.105}</property>

          <property name="advertisePort">${jboss.mod_cluster.advertise.port:23364}</property>

          <property name="excludedContexts">${jboss.mod_cluster.excludedContexts:ROOT,admin-console,invoker,jbossws,jmx-console,juddi,web-console}</property>

          <property name="autoEnableContexts">${jboss.mod_cluster.autoEnableContexts:true}</property>

          <property name="ssl">false</property>

          <property name="stickySession">true</property>

          <property name="stickySessionForce">false</property>

          <property name="stickySessionRemove">false</property>

          <property name="maxAttempts">1</property>

          <property name="workerTimeout">-1</property>

      </bean>

      ........................................

      ....................................

       

       

      Still sticky session is not working , session created from nodeA , further request can be post to modeB even jsessionid is attached in request header

      Any configutation wrong or missed ?

       

      Thanks,

      Siddharth