Load balancing with Apache mod_proxy [message #543299] |
Tue, 29 June 2010 01:32  |
Eclipse User |
|
|
|
I am running a RAP app on Tomcat, fronting it with Apache. Currently, I want to scale it up so that there are 2 Tomcat servers running behind Apache load balancer. I followed some tutorials on the web and it seems that the sessions messed up (It keeps showing "The server session timed out. Please click here to restart the session.")
I found this presentation slides (http://www.java-forum-stuttgart.de/jfs/2007/folien/A4.pdf) on Google. It said that "load balancing possible with standard apache mod_jk / mod_proxy, but requires some work". So how can I set it up correctly? or I have simply made some silly mistakes?
Here is my current Apache load balancer settings:
<Proxy balancer://tomcatcuster/>
BalancerMember ajp://server1:8009/ loadfactor=50 route=server1
BalancerMember ajp://server2:8010/ loadfactor=50 route=server2
ProxySet lbmethod=byrequests
</Proxy>
ProxyPass / balancer://tomcatcuster/ stickysession=JSESSIONID|jsessionid nofailover=On
ProxyPassReverse / ajp://server1:8009/
ProxyPassReverse / ajp://server2:8010/
Thx a lot.
|
|
|
|
Re: Load balancing with Apache mod_proxy [message #546109 is a reply to message #543299] |
Sun, 11 July 2010 06:33   |
Eclipse User |
|
|
|
Sorry for my late reply. I think we know what the problem is.
In our application, we turned coolies off so that multi-tabs browsing is supported. According to the RAP's FAQ, the application will append the session id into the url, rather than storing it in the cookies.
We have set the Apache load-balancer to direct the requests to the corresponding Tomcat server based on the session id in url. However, the application does not run correctly. After some investigation in the log file, we discovered that there are quite a lot 404 not found error, all of them are image/icon files. I am not sure if it is a problem of RAP.
Here is a RAP HTTP request for getting an icon:
GET rwt-resources/48.fwk1249086728/icons/icon.gif
The part "48.fwk1249086728" is dynamically generated, but the request URL does not contains the session id. So this request will be randomly dispatched by the load balancer even sticky session is set. This results a 404 error when the request is handled by a wrong server.
Due to this problem we have to enable cookies to make the load balancer works.
|
|
|
Re: Load balancing with Apache mod_proxy [message #546158 is a reply to message #546109] |
Sun, 11 July 2010 21:29  |
Eclipse User |
|
|
|
Hi,
about your problem with 404 error, there is already an opened bug for it:
317685: Images loaded from ext. points don't work behind session based
load balancers
https://bugs.eclipse.org/bugs/show_bug.cgi?id=317685
Best,
Ivan
On 07/11/2010 9:33 AM, KK wrote:
> Sorry for my late reply. I think we know what the problem is.
>
> In our application, we turned coolies off so that multi-tabs browsing
> is supported. According to the RAP's FAQ, the application will append
> the session id into the url, rather than storing it in the cookies.
>
> We have set the Apache load-balancer to direct the requests to the
> corresponding Tomcat server based on the session id in url. However,
> the application does not run correctly. After some investigation in
> the log file, we discovered that there are quite a lot 404 not found
> error, all of them are image/icon files. I am not sure if it is a
> problem of RAP.
>
> Here is a RAP HTTP request for getting an icon:
> GET rwt-resources/48.fwk1249086728/icons/icon.gif
>
> The part "48.fwk1249086728" is dynamically generated, but the request
> URL does not contains the session id. So this request will be randomly
> dispatched by the load balancer even sticky session is set. This
> results a 404 error when the request is handled by a wrong server.
>
> Due to this problem we have to enable cookies to make the load
> balancer works.
|
|
|
Powered by
FUDForum. Page generated in 0.07022 seconds