RE: Tomcat 4 load balancing
I don't know if this will help you but I am using apache to load balance and it works using the following config. # # workers.properties # # In Unix, we use forward slashes: ps=/ # list the workers by name worker.list=tomcat1, tomcat2, loadbalancer # # First tomcat server # worker.tomcat1.port=10009 worker.tomcat1.host=127.0.0.1 worker.tomcat1.type=ajp13 # Specify the size of the open connection cache. #worker.tomcat1.cachesize # # Specifies the load balance factor when used with # a load balancing worker. # Note: # > lbfactor must be > 0 # > Low lbfactor means less work done by the worker. worker.tomcat1.lbfactor=100 # # Second tomcat server # worker.tomcat2.port=12009 worker.tomcat2.host=127.0.0.1 worker.tomcat2.type=ajp13 # Specify the size of the open connection cache. #worker.tomcat2.cachesize # # Specifies the load balance factor when used with # a load balancing worker. # Note: # > lbfactor must be > 0 # > Low lbfactor means less work done by the worker. worker.tomcat2.lbfactor=100 # # Load Balancer worker # # # The loadbalancer (type lb) worker performs weighted round-robin # load balancing with sticky sessions. # Note: # > If a worker dies, the load balancer will check its state #once in a while. Until then all work is redirected to peer #worker. worker.loadbalancer.type=lb worker.loadbalancer.balanced_workers=tomcat1,tomcat2 # # END workers.properties # -Original Message- From: Rastislav Vasil [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 9:58 AM To: [EMAIL PROTECTED] Subject: Tomcat 4 load balancing Hi all, I'm trying to configure 2 Tomcat (4.1.12) instances on different hosts to serve under single IIS 5 web server. I defined 2 workers uriworkermap.properties: ### default.worker=lb /examples=$(default.worker) /examples/*=$(default.worker) workers.properties: # workers.tomcat_home=C:\Tomcat4.1 workers.java_home=C:\jdk1.3.0_01 worker.list=lb worker.w1.port=8009 worker.w1.host=localhost worker.w1.type=ajp13 worker.w2.port=8009 worker.w2.host=host2 worker.w2.type=ajp13 worker.w1.lbfactor=1 worker.w2.lbfactor=1 worker.loadbalancer.type=lb worker.loadbalancer.balanced_workers=w1, w2 ### I get The page cannot be displayed for http://localhost/examples I get following in isapi.log file: [Wed Mar 19 15:47:10 2003] [jk_connect.c (143)]: jk_open_socket, connect() failed errno = 61 [Wed Mar 19 15:47:10 2003] [jk_ajp12_worker.c (152)]: In jk_endpoint_t::service, Error sd = -1 [Wed Mar 19 15:47:10 2003] [jk_isapi_plugin.c (716)]: HttpExtensionProc error, service() failed What I'm trying to do is to have 2 Tomcats servering Java part of a single application. What I'm not sure is how to map balanced workers to a single url mapping in uriworkermap. props. According docs (http://localhost:8080/tomcat-docs/jk2/jk/workershowto.html) "balanced_workers is a comma separated list of workers that the load balancer need to manage. These workers should not appear in the worker.list property." - ... I don't have then there...- so if I'm balancing workers, should workers.list contain only the name of the load-balancing worker? To what worker(s) should the url mapping be set to? Thanks in advance. Rasto - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 4 load balancing
Hi, I' sorry, my mystake - lb is a type of the worker, while it's name is loadbalancer, I changed following: default.worker=lb --> default.worker=loadbalancer worker.list=lb --> worker.list=loadbalancer Now it works, but I have a question for one of my next steps: For some operations that write to a file I used to use a SYNCHRONIZED block of code to be sure to have only one user writing to the file. Probably that won't work when using 2 Tomcat instances to write to the same file - am I right? What is the solution/practise here? Thanks, Rasto -Original Message- From: Rastislav Vasil Sent: Wednesday, March 19, 2003 3:58 PM To: '[EMAIL PROTECTED]' Subject: Tomcat 4 load balancing Hi all, I'm trying to configure 2 Tomcat (4.1.12) instances on different hosts to serve under single IIS 5 web server. I defined 2 workers uriworkermap.properties: ### default.worker=lb /examples=$(default.worker) /examples/*=$(default.worker) workers.properties: # workers.tomcat_home=C:\Tomcat4.1 workers.java_home=C:\jdk1.3.0_01 worker.list=lb worker.w1.port=8009 worker.w1.host=localhost worker.w1.type=ajp13 worker.w2.port=8009 worker.w2.host=host2 worker.w2.type=ajp13 worker.w1.lbfactor=1 worker.w2.lbfactor=1 worker.loadbalancer.type=lb worker.loadbalancer.balanced_workers=w1, w2 ### I get The page cannot be displayed for http://localhost/examples I get following in isapi.log file: [Wed Mar 19 15:47:10 2003] [jk_connect.c (143)]: jk_open_socket, connect() failed errno = 61 [Wed Mar 19 15:47:10 2003] [jk_ajp12_worker.c (152)]: In jk_endpoint_t::service, Error sd = -1 [Wed Mar 19 15:47:10 2003] [jk_isapi_plugin.c (716)]: HttpExtensionProc error, service() failed What I'm trying to do is to have 2 Tomcats servering Java part of a single application. What I'm not sure is how to map balanced workers to a single url mapping in uriworkermap. props. According docs (http://localhost:8080/tomcat-docs/jk2/jk/workershowto.html) "balanced_workers is a comma separated list of workers that the load balancer need to manage. These workers should not appear in the worker.list property." - ... I don't have then there...- so if I'm balancing workers, should workers.list contain only the name of the load-balancing worker? To what worker(s) should the url mapping be set to? Thanks in advance. Rasto - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 4 load balancing
There are lots of solutions for stuff like this. You can get complicated or very simple. The simple answer is create a common 0 byte file when writing to the file and delete it when you are finished. Simply check for the existence of the file. A more complete solution would be to use an ejb or XML-RPC. XML-RPC is much simpler than an ejb. This would give you a 3rd JVM for common functionality across you application. You may not need to go here. You just need to evaluate how much time you want to spend ( and money ) to create a solution. -Original Message- From: Rastislav Vasil [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 10:10 AM To: [EMAIL PROTECTED] Subject: RE: Tomcat 4 load balancing Hi, I' sorry, my mystake - lb is a type of the worker, while it's name is loadbalancer, I changed following: default.worker=lb --> default.worker=loadbalancer worker.list=lb --> worker.list=loadbalancer Now it works, but I have a question for one of my next steps: For some operations that write to a file I used to use a SYNCHRONIZED block of code to be sure to have only one user writing to the file. Probably that won't work when using 2 Tomcat instances to write to the same file - am I right? What is the solution/practise here? Thanks, Rasto -Original Message- From: Rastislav Vasil Sent: Wednesday, March 19, 2003 3:58 PM To: '[EMAIL PROTECTED]' Subject: Tomcat 4 load balancing Hi all, I'm trying to configure 2 Tomcat (4.1.12) instances on different hosts to serve under single IIS 5 web server. I defined 2 workers uriworkermap.properties: ### default.worker=lb /examples=$(default.worker) /examples/*=$(default.worker) workers.properties: # workers.tomcat_home=C:\Tomcat4.1 workers.java_home=C:\jdk1.3.0_01 worker.list=lb worker.w1.port=8009 worker.w1.host=localhost worker.w1.type=ajp13 worker.w2.port=8009 worker.w2.host=host2 worker.w2.type=ajp13 worker.w1.lbfactor=1 worker.w2.lbfactor=1 worker.loadbalancer.type=lb worker.loadbalancer.balanced_workers=w1, w2 ### I get The page cannot be displayed for http://localhost/examples I get following in isapi.log file: [Wed Mar 19 15:47:10 2003] [jk_connect.c (143)]: jk_open_socket, connect() failed errno = 61 [Wed Mar 19 15:47:10 2003] [jk_ajp12_worker.c (152)]: In jk_endpoint_t::service, Error sd = -1 [Wed Mar 19 15:47:10 2003] [jk_isapi_plugin.c (716)]: HttpExtensionProc error, service() failed What I'm trying to do is to have 2 Tomcats servering Java part of a single application. What I'm not sure is how to map balanced workers to a single url mapping in uriworkermap. props. According docs (http://localhost:8080/tomcat-docs/jk2/jk/workershowto.html) "balanced_workers is a comma separated list of workers that the load balancer need to manage. These workers should not appear in the worker.list property." - ... I don't have then there...- so if I'm balancing workers, should workers.list contain only the name of the load-balancing worker? To what worker(s) should the url mapping be set to? Thanks in advance. Rasto - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 4 load balancing
I am testing config on 3 server (1 apache 2.0.43, 2 tomcat 4.1.12) with the mod_jk-2.0.43.so I don't understand how to define good values for the lbfactor to have same of tomcat session number on the two tomcat server. Can you help me to define the good value for lbfactory? Patrick GIRY Analyst Web e-mail : [EMAIL PROTECTED] Phone number : 33 1 64 80 30 91 -Message d'origine- De : Jackson, Stephen [mailto:[EMAIL PROTECTED] Envoyé : mercredi 19 mars 2003 16:31 A : 'Tomcat Users List' Objet : RE: Tomcat 4 load balancing There are lots of solutions for stuff like this. You can get complicated or very simple. The simple answer is create a common 0 byte file when writing to the file and delete it when you are finished. Simply check for the existence of the file. A more complete solution would be to use an ejb or XML-RPC. XML-RPC is much simpler than an ejb. This would give you a 3rd JVM for common functionality across you application. You may not need to go here. You just need to evaluate how much time you want to spend ( and money ) to create a solution. -Original Message- From: Rastislav Vasil [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 10:10 AM To: [EMAIL PROTECTED] Subject: RE: Tomcat 4 load balancing Hi, I' sorry, my mystake - lb is a type of the worker, while it's name is loadbalancer, I changed following: default.worker=lb --> default.worker=loadbalancer worker.list=lb --> worker.list=loadbalancer Now it works, but I have a question for one of my next steps: For some operations that write to a file I used to use a SYNCHRONIZED block of code to be sure to have only one user writing to the file. Probably that won't work when using 2 Tomcat instances to write to the same file - am I right? What is the solution/practise here? Thanks, Rasto -Original Message- From: Rastislav Vasil Sent: Wednesday, March 19, 2003 3:58 PM To: '[EMAIL PROTECTED]' Subject: Tomcat 4 load balancing Hi all, I'm trying to configure 2 Tomcat (4.1.12) instances on different hosts to serve under single IIS 5 web server. I defined 2 workers uriworkermap.properties: ### default.worker=lb /examples=$(default.worker) /examples/*=$(default.worker) workers.properties: # workers.tomcat_home=C:\Tomcat4.1 workers.java_home=C:\jdk1.3.0_01 worker.list=lb worker.w1.port=8009 worker.w1.host=localhost worker.w1.type=ajp13 worker.w2.port=8009 worker.w2.host=host2 worker.w2.type=ajp13 worker.w1.lbfactor=1 worker.w2.lbfactor=1 worker.loadbalancer.type=lb worker.loadbalancer.balanced_workers=w1, w2 ### I get The page cannot be displayed for http://localhost/examples I get following in isapi.log file: [Wed Mar 19 15:47:10 2003] [jk_connect.c (143)]: jk_open_socket, connect() failed errno = 61 [Wed Mar 19 15:47:10 2003] [jk_ajp12_worker.c (152)]: In jk_endpoint_t::service, Error sd = -1 [Wed Mar 19 15:47:10 2003] [jk_isapi_plugin.c (716)]: HttpExtensionProc error, service() failed What I'm trying to do is to have 2 Tomcats servering Java part of a single application. What I'm not sure is how to map balanced workers to a single url mapping in uriworkermap. props. According docs (http://localhost:8080/tomcat-docs/jk2/jk/workershowto.html) "balanced_workers is a comma separated list of workers that the load balancer need to manage. These workers should not appear in the worker.list property." - ... I don't have then there...- so if I'm balancing workers, should workers.list contain only the name of the load-balancing worker? To what worker(s) should the url mapping be set to? Thanks in advance. Rasto - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]