| Article: |
Clustering and Load Balancing in Tomcat 5, Part 2 | |
| Subject: | Fail over utility, Load balancing with URL redirecting | |
| Date: | 2004-08-23 17:02:36 | |
| From: | yogesh_prajapati | |
|
Response to: Fail over utility, Load balancing with URL redirecting
|
||
|
As such your server util class works fine but it always starts and stops MCastService as many times as no of rules configured in rules.xml. This process is repeated for ever single incoming request. I am not sure if this is a good approach to be adopted. During start/stop of this temporary McastService there are warnings generated on other tomcat instancess running "clusterapp", I have sent the stack trace to you via email.
|
||
Showing messages 1 through 2 of 2.
-
Fail over utility, Load balancing with URL redirecting
2006-03-17 06:36:55 ipolak [View]
-
Fail over utility, Load balancing with URL redirecting
2005-04-02 07:13:16 muki_man [View]
hi,
im trying to use the article and it was really good. do you any idea to integrate Apache Axis in the cluster? thanks!



On the point where the BalancerPortal class uses a hres.sendRedirect(encoded);
I implement the following strategy:
A) determine new URL (most of the time simple substring replacement)
B) get content of that URL (using e.g. apache's org.apache.commons.HttpClient)
note special treatment is necessary to handle POST requests, parameters need to be copied, but not all the request headers (since there is a length attribute which might give problems).
C) write content on the reponse outputstream of the doFilter parameter.
Note that in my current setup there is no security for the other nodes, but this could be implemented using htaccess rules by restricting clients to the ip of the balancer app.
I think the neatest approach would be to be able to specify a Strategy object using the xml configuration of the balancer so you can plug-in your own strategy class for handling a request.
Maybe I'll rewrite my solution in such a way.
First I must now make sure that all my sessions are Serializable....:)