Uploaded image for project: 'mod_cluster'
  1. mod_cluster
  2. MODCLUSTER-146

Quotes in jsessionId causing sticky sessions to fail

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.1.0.CR3
    • None
    • None
    • None

      I am having an issue trying to setup sticky sessions for following configuration:

      1 httpd front end
      2 backend jboss instances

      What I am noticing is when running in a cluster, the JSESSIONID contains quotes like:

      Set-Cookie: JSESSIONID="DE0F7EEA2A5E90497D729DB27DDB4B25.192.168.7.11:8009:jboss.web"; Version=1; Path=/f00

      Whilst not in a cluster:

      Set-Cookie: JSESSIONID=355F9E370912DC10187A15E8B02260CD; Path=/foo

      Now when I am looking in the httpd logging I see:

      mod_proxy_cluster.c(1681): cluster: Found value "54F0CFC4961C9ED14A64335B40645392.192.168.7.11:8009:jboss.web" for stickysession JSESSIONID

      In my opinion the quotes around the jsessionid is causing mod_proxy_cluster to fail in finding the jboss node to which to "stick" to.
      I recompiled mod_proxy_cluster with "HAVE_CLUSTER_EX_DEBUG" set for more debugging info and this confirmed my suspicion:

      mod_proxy_cluster.c(1739): find_nodedomain: finding node for 192.168.7.11:8009:jboss.web": mycluster
      mod_proxy_cluster.c(1752): find_nodedomain: finding domain for 192.168.7.11:8009:jboss.web": mycluster

      Looking in the code this shows that it was unable to find the node, due to the ending quote in the route.

      As for my JBoss Setup:

      • Uncommented ModClusterListener in jbossweb.sar/META-INF/jboss-beans.xml
      • mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml
      • changed ModClusterService to HAModClusterService
      • changed ${jboss.mod_cluster.advertise.enabled:false} to true

      As for my httpd setup:

      LoadModule proxy_module /opt/jboss/httpd/lib/httpd/modules/mod_proxy.so
      LoadModule proxy_ajp_module /opt/jboss/httpd/lib/httpd/modules/mod_proxy_ajp.so
      LoadModule slotmem_module /opt/jboss/httpd/lib/httpd/modules/mod_slotmem.so
      LoadModule manager_module /opt/jboss/httpd/lib/httpd/modules/mod_manager.so
      LoadModule proxy_cluster_module /opt/jboss/httpd/lib/httpd/modules/mod_proxy_cluster.so
      LoadModule advertise_module /opt/jboss/httpd/lib/httpd/modules/mod_advertise.so

      LogLevel debug

      CreateBalancers 0

      <VirtualHost *:80>

      <Location /mod_cluster-manager>
      SetHandler mod_cluster-manager

      Order deny,allow
      Deny from all
      Allow from all

      1. Allow from 192.168.7.
        </Location>

      <Directory />
      Order deny,allow
      Deny from all
      Allow from all
      </Directory>

      ProxyPass /foo balancer://mycluster/foo stickysession=JSESSIONID scolonpathdelim=On nofailover=On

      KeepAliveTimeout 60
      MaxKeepAliveRequests 0
      ManagerBalancerName mycluster
      AdvertiseFrequency 5

      </VirtualHost>

      Listen sebeco-dev-11:443
      <VirtualHost *:443>
      ServerName sebeco-dev-11:443
      SSLEngine on
      SSLProxyEngine on
      SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
      SSLCertificateFile "/opt/jboss/httpd/httpd/server.crt"
      SSLCertificateKeyFile "/opt/jboss/httpd/httpd/server.key"
      SSLCertificateChainFile "/opt/jboss/httpd/httpd/server-ca.crt"
      <FilesMatch "\.(cgi|shtml|phtml|php)$">
      SSLOptions +StdEnvVars
      </FilesMatch>

      <Location />
      Order allow,deny
      Allow from all
      </Location>

      ProxyPass /foo balancer://mycluster/foo stickysession=JSESSIONID scolonpathdelim=On nofailover=On
      </VirtualHost>

      As my setup is not really complex at this point my gut says I am doing something wrong in the setup, but digging in the code shows the opposite.
      Any thougts?

      Best regards,
      Wim.

              rhn-engineering-jclere Jean-Frederic Clere
              wvdhaute Wim Vandenhaute (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: