Re: Tomcat(5.5) Clustering and Load Balancing.
On 04/01/2011 06:47, Harsimranjit singh Kler wrote: So this means tomcat alone have not sufficent support for Load Balancing and clustering?. Correct. Tomcat does not provide a reverse proxy implementation. You main only way to achive is to use apache server HTTPD and connector, mod_jk things ?. You can use any reverse proxy you like. httpd + mod_jk is just one option. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat(5.5) Clustering and Load Balancing.
Hi Here is details: *Tomcat version*: 5.5.27 *OS*:Window XP *JDK*:1.6 *Environment Trying to Create* :Load balancing and Clustering on single Machine using tomcat instances only(balancer Feature) . *What i have Achieved*:i am running 4 instances of tomcat on ports 8080,9080,10080,11080.So port 8080 tomcat work as balancer and other works as cluster.(Using Multicasting IP and Port {check server.xml} it works fine). attached find server.xml,web.xml,rule.xml of balancer tomcat(8080). So using balancer feature in tomcat and rule.xml and some customized classes requests are successfully redirected to one of cluster ie 9080,10080 or 11080 instance. *Issue*:when request redirected from tomcat balancer(on 8080 port) to any cluster (tomcat instance on 9080,10080 or 11080 port) URL in address bar also changed. i dont want to display cluster URL.So how i can achive this?. i think org.apache.webapp.balancer.BalancerFilter class internally use SendRedirect() method . I tried with requestDispatcher..Forward() but it accept only realtive address. so please suggest me Thanks in advance Regards Harsimran On Tue, Dec 28, 2010 at 9:23 PM, David Smith david.sm...@cornell.eduwrote: On 12/28/2010 8:33 AM, Pid wrote: On 12/27/10 4:11 AM, Harsimranjit singh Kler wrote: Hi i have testing tomcat clustering on single machine.What i am able to do is i hv 4 tomcat instances 1 work as balancer and 3 as cluster.using Rule.xml in balancer with round robin approach.all requests hits on balancer redirected to on one cluster which is on some different port. when redirecting using sendredirect it display new url that is of cluster.i want some alternate so all request shoud handled at balancer and URL at adress bar not changed. i have tried forward from servelet but that is not accept only realtive URL. I'm sorry, I don't have any idea what you're actually asking. Please read: http://www.catb.org/~esr/faqs/smart-questions.html When you reply, please precisely detail your Tomcat, JVM and OS versions, also include an accurate description of the environment you have created and are trying to create. From what I read in the message, it appears the balancer is sending the browser a redirect (one of the 30x responses) which in turn changes the url in the browser's address bar. The OP (if I understand correctly) would like the url in the browser's address bar not to change at all (no 30x redirect response). The only way I can imagine that working is if the balancer acts as a reverse proxy, sending each request back to a different back-end worker. I think we need to see the balancer's config before we could even begin to offer suggestions. --David - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- Regards Harsimranjit Singh Kler ?xml version=1.0 encoding=UTF-8? rules !-- Redirect to server instance based on RoundRobinRule -- rule className=org.apache.webapp.balancer.rules.RoundRobinRule serverInstance=1 maxServerInstances=3 tcpListenAddress=127.0.0.1 tcpListenPort=4001 testWebPage=http://localhost:9080/clusterapp/test.jsp; redirectUrl=http://10.58.116.16:8080/WorkFlowEngine/; / rule className=org.apache.webapp.balancer.rules.RoundRobinRule serverInstance=2 maxServerInstances=3 tcpListenAddress=127.0.0.1 tcpListenPort=4002 testWebPage=http://localhost:10080/clusterapp/test.jsp; redirectUrl=http://10.58.116.16:8080/WorkFlowEngine/; / rule className=org.apache.webapp.balancer.rules.RoundRobinRule serverInstance=3 maxServerInstances=3 tcpListenAddress=127.0.0.1 tcpListenPort=4003 testWebPage=http://localhost:11080/clusterapp/test.jsp; redirectUrl=http://10.58.116.16:8080/WorkFlowEngine/; / !-- Default redirect if none of the above rules match -- rule className=org.apache.webapp.balancer.rules.AcceptEverythingRule redirectUrl=http://localhost:8080/balancer/testLB.jsp; / /rules ?xml version=1.0 encoding=UTF-8? !-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -- !-- Example Server Configuration File -- !-- Note that component elements are
Re: Tomcat(5.5) Clustering and Load Balancing.
Harsimranjit singh Kler wrote: Hi Here is details: *Tomcat version*: 5.5.27 *OS*:Window XP *JDK*:1.6 *Environment Trying to Create* :Load balancing and Clustering on single Machine using tomcat instances only(balancer Feature) . *What i have Achieved*:i am running 4 instances of tomcat on ports 8080,9080,10080,11080.So port 8080 tomcat work as balancer and other works as cluster.(Using Multicasting IP and Port {check server.xml} it works fine). attached find server.xml,web.xml,rule.xml of balancer tomcat(8080). So using balancer feature in tomcat and rule.xml and some customized classes requests are successfully redirected to one of cluster ie 9080,10080 or 11080 instance. *Issue*:when request redirected from tomcat balancer(on 8080 port) to any cluster (tomcat instance on 9080,10080 or 11080 port) URL in address bar also changed. i dont want to display cluster URL.So how i can achive this?. i think org.apache.webapp.balancer.BalancerFilter class internally use SendRedirect() method . I tried with requestDispatcher..Forward() but it accept only realtive address. I believe that David already gave you the basic answer. From what I read in the message, it appears the balancer is sending the browser a redirect (one of the 30x responses) which in turn changes the url in the browser's address bar. The OP (if I understand correctly) would like the url in the browser's address bar not to change at all (no 30x redirect response). The only way I can imagine that working is if the balancer acts as a reverse proxy, sending each request back to a different back-end worker. I don't think that what you want to achieve can be done (yet) with Tomcat alone. As a bit of an outsider's answer, I'll add this : from browsing the Tomcat cluster on-line documentation, it looks to me as a very impresive piece of work, but also as quite a complex setup. If your main purpose is to balance the load between a number of back-end Tomcat engines, I believe that using an Apache httpd front-end with either of the mod_proxy_ajp or the mod_jk connector, would be much easier to set up, and would provide exactly what you want : a single hostname:port for the clients, and load-balancing, and fail-over capabilities. It does that, because it would act like David indicates above, as a reverse proxy. In this kind of configuration, the clients (browsers e.g.) always talk to the same front-end server, and receive the responses from that front-end server. The front-end server in turn passes the requests to one of several back-end servers, and gets the response from them, which they then send back to the client. The clients always talk to the front-end server, and see only that one; they never even know that there are back-end servers, and never see the hostname:port of these back-end servers. Maybe the Tomcat cluster configuration does additional things which the front-end balancer setup cannot do. But that is an area that I really don't know, and maybe someone else can comment on that. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat(5.5) Clustering and Load Balancing.
On 1/3/11 9:40 AM, Harsimranjit singh Kler wrote: using tomcat instances only(balancer Feature) Why? http://tomcat.apache.org/tomcat-5.5-doc/balancer-howto.html#Using_the_balancer_webapp This is a simple implementation of a rules-based load balancer. It was not designed as a replacement for other load-balancing mechanisms used for high traffic environments. IMHO I'd suggest that it's not suitable for most environments. Just use HTTPD and mod_jk. p 0x62590808.asc Description: application/pgp-keys signature.asc Description: OpenPGP digital signature
Re: Tomcat(5.5) Clustering and Load Balancing.
So this means tomcat alone have not sufficent support for Load Balancing and clustering?. but i am able to check successfully: 1)Session maintaince2)Auto Deployment Only thing i am not able to achive to hide Cluster URL on redirection. You main only way to achive is to use apache server HTTPD and connector, mod_jk things ?. On Mon, Jan 3, 2011 at 7:44 PM, Pid p...@pidster.com wrote: On 1/3/11 9:40 AM, Harsimranjit singh Kler wrote: using tomcat instances only(balancer Feature) Why? http://tomcat.apache.org/tomcat-5.5-doc/balancer-howto.html#Using_the_balancer_webapp This is a simple implementation of a rules-based load balancer. It was not designed as a replacement for other load-balancing mechanisms used for high traffic environments. IMHO I'd suggest that it's not suitable for most environments. Just use HTTPD and mod_jk. p -- Regards Harsimranjit Singh Kler
Re: Tomcat(5.5) Clustering and Load Balancing.
On 12/27/10 4:11 AM, Harsimranjit singh Kler wrote: Hi i have testing tomcat clustering on single machine.What i am able to do is i hv 4 tomcat instances 1 work as balancer and 3 as cluster.using Rule.xml in balancer with round robin approach.all requests hits on balancer redirected to on one cluster which is on some different port. when redirecting using sendredirect it display new url that is of cluster.i want some alternate so all request shoud handled at balancer and URL at adress bar not changed. i have tried forward from servelet but that is not accept only realtive URL. I'm sorry, I don't have any idea what you're actually asking. Please read: http://www.catb.org/~esr/faqs/smart-questions.html When you reply, please precisely detail your Tomcat, JVM and OS versions, also include an accurate description of the environment you have created and are trying to create. p 0x62590808.asc Description: application/pgp-keys signature.asc Description: OpenPGP digital signature
Re: Tomcat(5.5) Clustering and Load Balancing.
On 12/28/2010 8:33 AM, Pid wrote: On 12/27/10 4:11 AM, Harsimranjit singh Kler wrote: Hi i have testing tomcat clustering on single machine.What i am able to do is i hv 4 tomcat instances 1 work as balancer and 3 as cluster.using Rule.xml in balancer with round robin approach.all requests hits on balancer redirected to on one cluster which is on some different port. when redirecting using sendredirect it display new url that is of cluster.i want some alternate so all request shoud handled at balancer and URL at adress bar not changed. i have tried forward from servelet but that is not accept only realtive URL. I'm sorry, I don't have any idea what you're actually asking. Please read: http://www.catb.org/~esr/faqs/smart-questions.html When you reply, please precisely detail your Tomcat, JVM and OS versions, also include an accurate description of the environment you have created and are trying to create. From what I read in the message, it appears the balancer is sending the browser a redirect (one of the 30x responses) which in turn changes the url in the browser's address bar. The OP (if I understand correctly) would like the url in the browser's address bar not to change at all (no 30x redirect response). The only way I can imagine that working is if the balancer acts as a reverse proxy, sending each request back to a different back-end worker. I think we need to see the balancer's config before we could even begin to offer suggestions. --David - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat(5.5) Clustering and Load Balancing.
Hi i have testing tomcat clustering on single machine.What i am able to do is i hv 4 tomcat instances 1 work as balancer and 3 as cluster.using Rule.xml in balancer with round robin approach.all requests hits on balancer redirected to on one cluster which is on some different port. when redirecting using sendredirect it display new url that is of cluster.i want some alternate so all request shoud handled at balancer and URL at adress bar not changed. i have tried forward from servelet but that is not accept only realtive URL. regards HArry