Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 4781 invoked from network); 23 Mar 2011 15:43:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Mar 2011 15:43:18 -0000 Received: (qmail 91589 invoked by uid 500); 23 Mar 2011 15:43:14 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 91519 invoked by uid 500); 23 Mar 2011 15:43:14 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 91510 invoked by uid 99); 23 Mar 2011 15:43:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Mar 2011 15:43:14 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of aw@ice-sa.com designates 212.85.38.228 as permitted sender) Received: from [212.85.38.228] (HELO tor.combios.es) (212.85.38.228) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Mar 2011 15:43:09 +0000 Received: from [192.168.245.129] (p549E8A52.dip0.t-ipconnect.de [84.158.138.82]) by tor.combios.es (Postfix) with ESMTPA id 535A3226132 for ; Wed, 23 Mar 2011 16:42:47 +0100 (CET) Message-ID: <4D8A14F5.3050608@ice-sa.com> Date: Wed, 23 Mar 2011 16:42:45 +0100 From: =?ISO-8859-1?Q?Andr=E9_Warnier?= Reply-To: Tomcat Users List User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: reverse proxy and tomcat References: <6F10FFAA-D4A5-4859-A162-457D059C800A@yale.edu> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Just a vague suspicion.. What are the hostnames which you use in your workers.properties, for the Tomcats ? J�nos L�bb wrote: > Hi Igor, > > I use mod-proxy to balance the apaches/httpds. I use mod-jk t balance the tomcats. For the tomcats f course I also have the workers.properties files in the apache2/conf directory. When invoke the URL to the individual balance members, everything works fine. It is when I try to use the reverse proxy then every attempt to any of the tomcats creates a new session, so fail over does not work. > > Thanks, > > J�nos > On Mar 22, 2011, at 6:59 PM, Igor Cicimov wrote: > >> Interesting I had no idea you can mix mod_proxy and mod_jk, thought you >> should use the one or the other. What I do I have workers.properties file in >> the Apache conf directory with load-balancer worker that takes care of the >> load balancing ans sticky sessions. >> >> On Wed, Mar 23, 2011 at 8:54 AM, J�nos L�bb wrote: >> >>> Hi, >>> >>> I have two machines bml0065.yalepath.org and bml0066.yalepath.org. Both >>> have OSX 10.6.6, apache 2.2.17 and mod_jk 1.2.31 installed. Tomcat is >>> 7.0.10 on both. >>> >>> Apache was compiled on both machines with proxy, proxy-balancer, proxy-http >>> and proxy-ajp enabled. >>> >>> The bml0065 machine is configured as a reverse proxy. >>> >>> The theory is, that users hit the bml0065 machine like >>> >>> http://bml0065.yalepath.org/tc/examples/servlets/servlet/SessionExample >>> >>> and using mod-proxy and mod-proxy-http it will select either bml0065 or >>> bml0066 depending on the lbmethod configured. Then let say it selects >>> bml0065. Then it comes to this machine as: >>> >>> http://bml0065.yalepath.org/examples/servlets/servlet/SessionExample >>> >>> From here, because there is a JkMount for examples in its httpd.conf, it >>> connects via mod_jk to the Tomcat instance on this machine, in this case >>> tomcat3. >>> >>> The problem is that as soon the reverse proxy is involved new sessions are >>> created all the time, so session failover do not work. If I take the >>> reverse proxy out from the picture, everything works. >>> >>> Here is the reverse proxy config from httpd.conf of the bml0065 machine >>> >>> JkLogLevel info >>> JkMount /examples/* lb >>> JkMount /examples/servlets/servlet/* lb >>> JkMount /jkmanager/* jkstatus >>> JkWorkersFile "/usr/local/apache2/conf/workers.properties" >>> JkLogFile "/usr/local/apache2/logs/mod_jk.log >>> >>> ProxyRequests Off >>> >>> BalancerMember http://bml0065.yalepath.org loadfactor=10 >>> route=tomcat3 >>> BalancerMember http://bml0066.yalepath.org loadfactor=10 >>> route=tomcat1 >>> ProxySet lbmethod=bytraffic >>> >>> ProxyPass /tc/ balancer://pathCluster/ >>> stickysession=JSESSIONID|jsessionid >>> ProxyPassReverse /tc/ balancer://pathCluster/ >>> >>> >>> >>> SetHandler balancer-manager >>> Order Deny,Allow >>> Allow from .yalepath.org >>> >>> >>> A very similar setup worked in 2009 with Tomcat 6.0.18 and httpd 2.2.11. >>> >>> Here are the snippets from both machine catalina.out file >>> >>> >>> Mar 22, 2011 5:06:11 PM org.apache.catalina.core.ApplicationContext log >>> INFO: SessionListener: >>> sessionCreated('0409F29D221545DB0BB5F62205B24471.tomcat3') >>> Mar 22, 2011 5:06:11 PM org.apache.catalina.core.ApplicationContext log >>> INFO: SessionListener: >>> attributeAdded('0409F29D221545DB0BB5F62205B24471.tomcat3', 's1', 't3') >>> Mar 22, 2011 5:07:06 PM org.apache.catalina.core.ApplicationContext log >>> INFO: SessionListener: >>> sessionCreated('DE7A014A0F1659F0B777E0DF4A2355D4.tomcat3') >>> Mar 22, 2011 5:07:06 PM org.apache.catalina.core.ApplicationContext log >>> INFO: SessionListener: >>> attributeAdded('DE7A014A0F1659F0B777E0DF4A2355D4.tomcat3', 's2', 't3') >>> >>> >>> >>> Mar 22, 2011 5:06:11 PM org.apache.catalina.core.ApplicationContext log >>> INFO: SessionListener: >>> sessionCreated('0409F29D221545DB0BB5F62205B24471.tomcat3') >>> Mar 22, 2011 5:06:11 PM org.apache.catalina.core.ApplicationContext log >>> INFO: SessionListener: >>> attributeAdded('0409F29D221545DB0BB5F62205B24471.tomcat3', 's1', 't3') >>> Mar 22, 2011 5:07:06 PM org.apache.catalina.core.ApplicationContext log >>> INFO: SessionListener: >>> sessionCreated('DE7A014A0F1659F0B777E0DF4A2355D4.tomcat3') >>> Mar 22, 2011 5:07:06 PM org.apache.catalina.core.ApplicationContext log >>> INFO: SessionListener: >>> attributeAdded('DE7A014A0F1659F0B777E0DF4A2355D4.tomcat3', 's2', 't3') >>> >>> >>> >>> Here is the last access session from the access_log: >>> >>> 10.84.2.65 - - [22/Mar/2011:17:06:11 -0400] "POST >>> /examples/servlets/servlet/SessionExample HTTP/1.1" 200 1114 >>> 10.84.2.41 - - [22/Mar/2011:17:06:11 -0400] "POST >>> /tc/examples/servlets/servlet/SessionExample HTTP/1.1" 200 1114 >>> 10.84.2.65 - - [22/Mar/2011:17:06:11 -0400] "GET >>> /examples/servlets/images/code.gif HTTP/1.1" 304 - >>> 10.84.2.41 - - [22/Mar/2011:17:06:11 -0400] "GET >>> /tc/examples/servlets/images/code.gif HTTP/1.1" 304 - >>> 10.84.2.65 - - [22/Mar/2011:17:06:11 -0400] "GET >>> /examples/servlets/images/return.gif HTTP/1.1" 304 - >>> 10.84.2.41 - - [22/Mar/2011:17:06:11 -0400] "GET >>> /tc/examples/servlets/images/return.gif HTTP/1.1" 304 - >>> ::1 - - [22/Mar/2011:17:06:18 -0400] "OPTIONS * HTTP/1.0" 200 - >>> ::1 - - [22/Mar/2011:17:06:19 -0400] "OPTIONS * HTTP/1.0" 200 - >>> 10.84.2.65 - - [22/Mar/2011:17:07:06 -0400] "POST >>> /examples/servlets/servlet/SessionExample HTTP/1.1" 200 1114 >>> 10.84.2.41 - - [22/Mar/2011:17:07:06 -0400] "POST >>> /tc/examples/servlets/servlet/SessionExample HTTP/1.1" 200 1114 >>> >>> >>> The 10.84.2.41 is my machine. In the log above looks like the hit to the >>> reverse proxy - with the /tc/ start - inserted later than the converted url >>> for the given balance member. >>> >>> There is nothing interesting in the apache error_log. >>> >>> What am I doing wrong ? >>> >>> This is a test cluster. The application developer wants to test his app's >>> failover by pulling the ethernet plug out from the non reverse proxy when >>> the session is on that machine. >>> >>> Thanks ahead, >>> >>> J�nos >>> >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org >>> For additional commands, e-mail: users-help@tomcat.apache.org >>> >>> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org