You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jo...@ceridian.ca on 2010/08/18 22:34:48 UTC

[users@httpd] mod_balancer_proxy not balancing as expected (not sticky)

Hello,

I'm trying to configure Apache as a reverse proxy to load balance across 3 
web/app servers.  It must be sticky for sessions to work properly, and 
JSESSIONID is apparently the value I should use for this app.

For some reason, even though it detects the JSESSIONID value and assigns 
the request to the correct route, the request is routed to an incorrect 
(ie didn't remain sticky) server.  For example, it sends me to app1 then 
app2.  I thought if I started with app1 it would stick with app1 assuming 
it detected my JSESSIONID.  For some reason, it's jumping all around.  See 
debug log below and you'll see the way it's doing this.

RHEL 5.5
Server version: Apache/2.2.3
Server built:   Mar  4 2010 09:57:54
Server's Module Magic Number: 20051115:3
Server loaded:  APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/etc/httpd"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="run/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

Here's my config:
----------------------
NameVirtualHost *:80
NameVirtualHost *:8080

ProxyVia Full

<VirtualHost *:80>
  ServerName bwd1finpxy01.corpadds.com
</VirtualHost>

<VirtualHost *:8080>
  LogLevel Debug
  ServerName oebs.finprod.ceridian.net

  ProxyRequests     Off

  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>

  <Location /balancer-manager>
        SetHandler balancer-manager
        Order Deny,Allow
        Deny from all
        Allow from 10.0.0.0/8
        Allow from 170.153.0.0/16
        Allow from 127.0.0.1
  </Location>


  ProxyPreserveHost On
  ProxyPass /balancer-manager !
  ProxyPass / balancer://internalapp/ lbmethod=byrequests 
stickysession=JSESSIONID|jsessionid nofailover=On
  ProxyPassReverse  / balancer://internalapp/

  <Proxy balancer://internalapp>
        BalancerMember http://bwd1finapp01.corpadds.com:8001 route=app01 
loadfactor=1
        BalancerMember http://bwd1finapp02.corpadds.com:8001 route=app02 
loadfactor=1
        BalancerMember http://bwd1finapp03.corpadds.com:8001 route=app03 
loadfactor=1
  </Proxy>

</VirtualHost>

---------------------------------------

and here's some output from the debug log, where you see it sending 
requests to different bancer members:

-------------------------------------
[Wed Aug 18 13:57:49 2010] [debug] mod_proxy_balancer.c(276): proxy: 
BALANCER: Found value 
de92e7414f39683a7a8066a272f1271fe0e55951b07c202f1799f225c14459b8.e38Lax8PchqPbO0TbhqNahmRc3b0 
for stickysession JSESSIONID|jsessionid
[Wed Aug 18 13:57:49 2010] [debug] mod_proxy_balancer.c(286): proxy: 
BALANCER: Found route e38Lax8PchqPbO0TbhqNahmRc3b0
[Wed Aug 18 13:57:49 2010] [debug] mod_proxy_balancer.c(535): proxy: 
BALANCER (balancer://internalapp) worker (
http://bwd1finapp02.corpadds.com:8001) rewritten to 
http://bwd1finapp02.corpadds.com:8001/OA_HTML/AppsLogin
[Wed Aug 18 13:57:49 2010] [debug] mod_proxy_balancer.c(276): proxy: 
BALANCER: Found value 
de92e7414f39683a7a8066a272f1271fe0e55951b07c202f1799f225c14459b8.e38Lax8PchqPbO0TbhqNahmRc3b0 
for stickysession JSESSIONID|jsessionid
[Wed Aug 18 13:57:49 2010] [debug] mod_proxy_balancer.c(286): proxy: 
BALANCER: Found route e38Lax8PchqPbO0TbhqNahmRc3b0
[Wed Aug 18 13:57:49 2010] [debug] mod_proxy_balancer.c(535): proxy: 
BALANCER (balancer://internalapp) worker (
http://bwd1finapp03.corpadds.com:8001) rewritten to 
http://bwd1finapp03.corpadds.com:8001/OA_HTML/AppsLocalLogin.jsp?langCode=US
[Wed Aug 18 13:57:54 2010] [debug] mod_proxy_balancer.c(276): proxy: 
BALANCER: Found value 
de92e7414f39683a7a8066a272f1271fe0e55951b07c202f1799f225c14459b8.e38Lax8PchqPbO0TbhqNahmRc3b0 
for stickysession JSESSIONID|jsessionid
[Wed Aug 18 13:57:54 2010] [debug] mod_proxy_balancer.c(286): proxy: 
BALANCER: Found route e38Lax8PchqPbO0TbhqNahmRc3b0
[Wed Aug 18 13:57:54 2010] [debug] mod_proxy_balancer.c(535): proxy: 
BALANCER (balancer://internalapp) worker (
http://bwd1finapp03.corpadds.com:8001) rewritten to 
http://bwd1finapp03.corpadds.com:8001/OA_HTML/RF.jsp?function_id=28566&resp_id=-1&resp_appl_id=-1&security_group_id=0&lang_code=US&params=PxXpiqMs416s7FG5eW95o8UFiVkywaIKgiQWsKNGTFY&oas=L2Ypksutic3wM1XKz7SKEg.
.
[Wed Aug 18 13:57:55 2010] [debug] mod_proxy_balancer.c(276): proxy: 
BALANCER: Found value 
de92e7414f39683a7a8066a272f1271fe0e55951b07c202f1799f225c14459b8.e38Lax8PchqPbO0TbhqNahmRc3b0 
for stickysession JSESSIONID|jsessionid
[Wed Aug 18 13:57:55 2010] [debug] mod_proxy_balancer.c(286): proxy: 
BALANCER: Found route e38Lax8PchqPbO0TbhqNahmRc3b0
[Wed Aug 18 13:57:55 2010] [debug] mod_proxy_balancer.c(535): proxy: 
BALANCER (balancer://internalapp) worker (
http://bwd1finapp01.corpadds.com:8001) rewritten to 
http://bwd1finapp01.corpadds.com:8001/OA_HTML/cabo/styles/cache/swanEXTN-custom-2_3_6_5-en-gecko.css
[Wed Aug 18 13:57:55 2010] [debug] mod_proxy_balancer.c(276): proxy: 
BALANCER: Found value 
de92e7414f39683a7a8066a272f1271fe0e55951b07c202f1799f225c14459b8.e38Lax8PchqPbO0TbhqNahmRc3b0 
for stickysession JSESSIONID|jsessionid
[Wed Aug 18 13:57:55 2010] [debug] mod_proxy_balancer.c(286): proxy: 
BALANCER: Found route e38Lax8PchqPbO0TbhqNahmRc3b0
[Wed Aug 18 13:57:55 2010] [debug] mod_proxy_balancer.c(535): proxy: 
BALANCER (balancer://internalapp) worker (
http://bwd1finapp02.corpadds.com:8001) rewritten to 
http://bwd1finapp02.corpadds.com:8001/OA_HTML/cabo/jsLibs/Common2_3_6_5.js
----------------------------------------


Any suggestions or tips regarding debugging this would be appreciated.




This communication is intended to be received only by the individual[s] or entity[s] to whom or to which it is addressed, and contains information which is confidential, privileged and subject to copyright.  Any unauthorized use, copying, review or disclosure is prohibited.  Please notify the sender immediately if you have received this communication in error [by calling collect, if necessary] so that we can arrange for its return at our expense.  Thank you in advance for your anticipated assistance and cooperation.


Cette communication est destinée uniquement à la personne ou à la personne morale à qui elle est adressée. Elle contient de l’information confidentielle, protégée par le secret professionnel et sujette à des droits d'auteurs. Toute utilisation, reproduction, consultation ou divulgation non autorisées sont interdites. Nous vous prions d’aviser immédiatement l’expéditeur si vous avez reçu cette communication par erreur (en appelant à frais virés, si nécessaire), afin que nous puissions prendre des dispositions pour en assurer le renvoi à nos frais. Nous vous remercions à l’avance de votre coopération.