4 Replies Latest reply on Apr 26, 2011 5:35 AM by jfclere

    Problem getting mod_cluster to recognize existing JSESSIONID's via stickysessions

    john.miller

      We are having a problem getting mod_cluster to recognize existing JSESSIONID's via stickysessions in EWS (apache only). Instead it is issuing new session ids and connecting to the incorrect node in the balancer during an established session.

       

      This is very similar to the issue found here in RedHat DOC-17273:

       

      https://access.redhat.com/kb/docs/DOC-17273

       

      We have tried the fix suggested in DOC-17273 but this does not fix the issue.

       

      We believe the issue lies somewhere in the configuration of apache/mod_cluster as we are not seeing critical debug log output from the mod_cluster module. In particular, we should see something like the following when an existing session via JSESSIONID arrives into mod_cluster:

       

      ---

      [Mon Jan 24 11:42:26 2011] [debug] mod_proxy_cluster.c(1628): cluster: Found value pqMwwCnQX3wP0cRIpX0e1g__.node1 for stickysession JSESSIONID|jsessionid

      [Mon Jan 24 11:42:26 2011] [debug] mod_proxy_cluster.c(1956): cluster: Using route node1

      [Mon Jan 24 11:42:26 2011] [debug] mod_proxy_cluster.c(943): get_balancer_by_node found context /application1

      [Mon Jan 24 11:42:26 2011] [debug] mod_proxy.c(993): Running scheme balancer handler (attempt 0)

      [Mon Jan 24 11:42:26 2011] [debug] mod_proxy_ajp.c(644): proxy: AJP: serving URL ajp://192.168.0.10:8009/application1/

      ---

       

      Instead we see:

       

      ---

      [Wed Apr 13 13:23:31 2011] [debug] mod_proxy_cluster.c(943): get_balancer_by_node found context /buttercup

      [Wed Apr 13 13:23:31 2011] [debug] mod_proxy_cluster.c(943): get_balancer_by_node found context /buttercup

      [Wed Apr 13 13:23:31 2011] [debug] mod_proxy_cluster.c(943): get_balancer_by_node found context /buttercup

      [Wed Apr 13 13:23:31 2011] [debug] mod_proxy_cluster.c(1134): proxy: byrequests balancer DONE (ajp://10.200.65.11:8009)

      [Wed Apr 13 13:23:31 2011] [debug] mod_proxy.c(993): Running scheme balancer handler (attempt 0)

      [Wed Apr 13 13:23:31 2011] [debug] mod_proxy_http.c(1930): proxy: HTTP: declining URL ajp://10.200.65.11:8009/

      [Wed Apr 13 13:23:31 2011] [debug] mod_proxy_ajp.c(644): proxy: AJP: serving URL ajp://10.200.65.11:8009/

      ---

       

      (Note: These two debug snippets are from two different sources; the first from a working Internet example and the latter from our own (not working) configuration.)

       

      The key here is that in our configuration we are not seeing the "cluster: Found value.." line AND the "cluster: Using route node1..." line. For some reason our apache/mod-clusterconfiguration is not able to find the JSESSIONID and route information.

       

      Do you have an idea why this is happening? I can provide any addtional configuration file that you need. Just let me know which ones are useful to you. Also, here are the versions and configurations that we are using:

       

       

      - RedHat EAP 5.1.0

      - RedHat EWS 1.0.1

      - RedHat ep native 5.1.0

      - mod_cluster module 1.0.4

       

      Note: we are using only apache in EWS as a frontend to a 2-node clustered (HAModCluster) EAP cluster.

        • 1. Problem getting mod_cluster to recognize existing JSESSIONID's via stickysessions
          jfclere

          Without a longer extract of error_log and the httpd.conf configuration file. It is impossible to see what is wrong.

          • 2. Problem getting mod_cluster to recognize existing JSESSIONID's via stickysessions
            john.miller

            I have attached our 3 primary config. files and a zip of our error log from the last 2 days (we experimented with the config. settings over this time period). 

             

            We think our problem is all of the rewrite rules in our config. file:  benefits.gov-VirtualHosts.conf.  We inherited these rewrite rules from the web app. that we are porting from Websphere to JBoss -- the web app. belongs to our customer, and our job is to port it to JBoss.  So we aren't really able to just get rid of the rewrite rules.  We just have to figure out how to make them work with mod_cluster 1.0.4. 

             

            So our question is:  how do we go about using a mix of rewrite rules and mod_cluster/proxypass?   Right now, we are using "rewriterule [P]" to pass to the reverse proxy balancer://cluster1?  Is this the correct way?  We’ve tried proxypass as well with same results.

             

            Thanks for your help!

            • 3. Problem getting mod_cluster to recognize existing JSESSIONID's via stickysessions
              john.miller

              We got it working by making some mods in httpd.conf.  I've attached the new httpd.conf ("httpd.conf.new") so you can diff and see the relatively minor changes.  We essentially bypass mod_cluster on the httpd side.  Our rewrite rules essentially do this.  And we inherited these rules in the app that we are porting to JBoss, so we really aren't at liberty to modify them (and even if we could, we don't really have the time to parse, modify, and test them all). 

              We tried the suggestions in https://access.redhat.com/kb/docs/DOC-34600, but then we lost sticky sessions(which is the original problem that we ran into).  We tried using the ProxySet to force sticky sessions, but that didn't work either.  Here's what we unsuccessfully tried:

              <Proxy balancer://cluster1>

                    Order deny,allow

                    ProxySet stickysession=JSESSIONID|jsessionid nofailover=On scolonpathdelim=On

                    Allow from all

              </Proxy>

              Do you know if this problem is fixed in mod_cluster 1.0.6 or 1.1?

              Perhaps more importantly, do you see any major drawbacks to our workaround?


              • 4. Problem getting mod_cluster to recognize existing JSESSIONID's via stickysessions
                jfclere

                According to the error_log you were not receiving the information from the nodes, so you weren't really using mod_cluster.