Load Balancing and Sticky Sessions with mod_jk2
I've been playing with this all day. One Apache 2.0.47 machine with jk2 wanting desperately to talk to two tomcat servers. I started this days adventure with mod_jk only to read that sticky sessions wouldn't work with a non --enable-mpm=worker compiled version of apache. (is this true??) I then recompiled apache and mod_jk2 but the configuration syntax is different. in mod_jk land it would something like: worker.tomcat1.port=11009 worker.tomcat1.host=localhost worker.tomcat1.type=ajp13 worker.tomcat1.lbfactor=100 worker.tomcat2.port=12009 worker.tomcat2.host=localhost worker.tomcat2.type=ajp13 worker.tomcat2.lbfactor=100 with the corresponding jvmRoutes and port changes added on the servers. I guess I need an someone who is using different machines for web and tomcat with an example workers2.properties they could email to help me along or some one to answer a question or two. How do I do a worker.type=loadbalance in jk2 syntax? How do I write the correspondiong entries into the workers2.properties file to tell apache about my two tomcat servers and to share the .jsp load between them?. TIA -David Obrien
Re: J2SDK 1.4.2_01 + Linux + file.encoding
I face the same problem but haven't found a solution yet. I had to revert to the old version of the SDK. If you find anything could you let me know? -Dave At 12:12 PM 10/27/2003, you wrote: Hi everyone, I have the following configuration: Linux Mandrake 8.0 J2SDK 1.4.2_01 Tomcat 4.1.27 In my application I have to read some files that contains characters that are ISO-8859-1 charset but when I display these file contents by Tomcat the ISO-8859-1 characters are replaced by question marks, Tomcat is started with the parameter -Dfile.encoding=ISO-8859-1. The detail is that if I use J2SDK1.4.1 everything works fine! I would like to know if someone here faced this problem and/or has some tip how to solve it. Thanks in advance, Luiz Ricardo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] David G. O'Brien Web Services Coordinator / Systems Administrator NACCRRA The Nation's Network of Child Care Resource & Referral 1319 F Street NW, Suite 500 Washington, DC 20004 (202) 393-5501 ext. 113 (202) 393-1109 fax
Would this work? (Load Balance Question)
I have one apache web server conversing with two separate tomcat servers with access a fourth MySql server. Could I set it up like this? The Internet | | (real IP addresses) -- External Network | --- ------ --- | | | || | | | |W| |T||T| |M| |W| |C||C| |Y| |W| | || | |S| | | |1||2| |Q| | | | || | |L| | | | || | | | --- ------ --- | | | | --- Internal Network --- (192.168.0. addresses) All the machines have 2 nics on board. I am worried that the other external network traffic is slowing my response time, So I'd like to separate the backend processing from the external network. -Dave David G. O'Brien Web Services Coordinator / Systems Administrator NACCRRA The Nation's Network of Child Care Resource & Referral 1319 F Street NW, Suite 500 Washington, DC 20004 (202) 393-5501 ext. 113 (202) 393-1109 fax
Re: Please Help: Inconsistent Load Balancing info mod_jk2
Higher the number ... More Hits I have one worker at lb_factor=4 and one at lb_factor=8 and the distribution if I have 150 sessions active the server with lb_factor=4 has 49 and the server with lb_factor=8 has 101 This can be seen at @ http://www.nacrraware.net/cluster/ -Dave At 10:32 AM 12/2/2003, Asif Chowdhary wrote: The apache documentation say that higher the number the greater the number of requests which tomcat will receive. The tomcat definitive Guide from orielly says that the lower the number the greater the number of requests a tomcat instance will receive. What is correct? Which instance will get more requests? First or Second #First instance of tomcat in workers2.properties lb_factor = 10 #Second instance of tomcat in workers2.properties lb_factor = 20 Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] David G. O'Brien Web Services Coordinator / Systems Administrator NACCRRA The Nation's Network of Child Care Resource & Referral 1319 F Street NW, Suite 500 Washington, DC 20004 (202) 393-5501 ext. 113 (202) 393-1109 fax
RE: mod_jk worker help please!!
I see no jvm="workers83" in the sever.xml file ??? -Dave Yes, I have that. So, why would it ignore my worker.list for the workers I define? 2003-12-04 17:16:58 Ajp13Connector[8009] Starting background thread 2003-12-04 17:16:58 Ajp13Processor[8009][0] Starting background thread 2003-12-04 17:16:58 Ajp13Processor[8009][1] Starting background thread 2003-12-04 17:16:58 Ajp13Processor[8009][2] Starting background thread 2003-12-04 17:16:58 Ajp13Processor[8009][3] Starting background thread 2003-12-04 17:16:58 Ajp13Processor[8009][4] Starting background thread "Sullivan, Patrick" To: "Stephanie A Bickel" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED] <[EMAIL PROTECTED]> entura.Org>cc: Subject: RE: mod_jk worker help please!! 12/05/2003 09:56 AM Please respond to "Tomcat Users List" Check you tomcat logs for Ajp13Connector[8883] Opening server socket on all host IP addresses Ajp13Connector[8883] Starting background thread Ajp13Processor[8883][0] Starting background thread Ajp13Processor[8883][1] Starting background thread Ajp13Processor[8883][2] Starting background thread Ajp13Processor[8883][3] Starting background thread Ajp13Processor[8883][4] Starting background thread My server.xml: My workers.properties: workers.apache_log=/usr/local/webservers/a2047d/logs workers.catalina_home=/usr/local/webservers/t4129 workers.java_home=/usr/java131 ps=/ # Define 1 real worker using ajp13 worker.list=worker83 # Set properties for worker83 (ajp13) worker.worker83.type=ajp13 worker.worker83.host=localhost worker.worker83.port=8883 worker.worker83.lbfactor=50 worker.worker83.cachesize=10 worker.worker83.cache_timeout=600 worker.worker83.socket_keepalive=1 worker.worker83.socket_timeout=300 My httpd.conf (part of it atleast): ... Listen 172.29.222.160:83 #Compiled in modules: # core.c # mod_access.c # mod_auth.c # mod_auth_dbm.c # mod_include.c # worker.c # http_core.c # mod_mime.c # mod_cgid.c # mod_dir.c # mod_alias.c # mod_so.c LoadModule auth_ldap_module modules/mod_auth_ldap.so LoadModule jk_module modules/mod_jk.so User lawweb ... # Where to find workers.properties JkWorkersFile /usr/local/webservers/a2047d/conf/workers.properties83 JkLogFile /usr/local/webservers/a2047d/logs/mod_jk83.log # Set the jk log level [debug/error/info] JkLogLevel info JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories JkRequestLogFormat "%w %V %T" JkMount /*.jsp worker83 JkMount /servlet/* worker83 JkMount /examples/* worker83 AllowOverride AuthConfig AuthType Basic AuthName "onyx TESTPL" AuthDBMUserFile /usr/local/webservers/law_web/userdb/lawson AuthDBMAuthoritative Off AuthLDAPAuthoritative On LDAP_Debug Off LDAP_Protocol_Version 3 LDAP_Server someADservers LDAP_Port 389 Base_DN "some baseDN" Bind_DN "someDN" Bind_Pass "somepassowrd" UID_Attr sAMAccountName Options Indexes Options FollowSymLinks require valid-user Buy you may have noticed I am actually running 2.0.48 Thank you, Patrick Sullivan Centura Health 303-643-4021 -Original Message- From: Stephanie A Bickel [mailto:[EMAIL PROTECTED] Sent: Thursday, December 04, 2003 3:54 PM To: [EMAIL PROTECTED] Subject: mod_jk worker help please!! I am trying to configure Apache 1.3.X with tomcat 4.1.29. I am trying to use the connector mod_jk for connect the two. I am having the following problem: In my workers.properties I have a worker I defined as test (or a thousand other names). No matter how I change my worker.properties, an instance of ajp12 seems to be created. I don't understand!! I have been working on this for days and any help would be appreciated. Here are my config files: server.xml has workers.properties: workers.tomcat_home=C:\tomcat workers.java_home=C:\MMIS_IAS\jdk workers.th=C:\tomcat ps=\ worker.list=test worker.test.port=8009 worker.test.host=localhost worker.test.type=ajp13 http.conf: LoadModule jk_module modules/mod_jk.dll AddModule mod_jk.c JkWorkersFile "C:/Tomcat/conf/jk/workers.properties" JkLogFile "C:/tomcat/logs/mod_jk.log" JkLogLevel debug JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " my mod_jk.log says: [Tue Dec 02 17:52:45 2003] [jk_worker.c (88)]: Into wc_open [Tue Dec 02 17:52:45 2003] [jk_worker.c (222)]: Into build_worker_map, creating 1 workers [Tue Dec 02 17:52:45 2003] [jk_worker.c (228)]: build_worker_map, creating worker ajp12 [Tue Dec 02 17:52:45 2003] [jk_worker.c (148)]: Into wc_create_worker [Tue Dec 02 17:52:45 2003] [jk_worker.c (162)]: wc_create_worker, abo
RE: mod_jk worker help please!!
From my server.xml port="8009" minProcessors="50" maxProcessors="100" acceptCount="100" debug="0"/> the JVMROUTE has to be the same as the worker name or session won't be sticky... -Dave At 01:26 PM 12/5/2003, Stephanie A Bickel wrote: Dave - I have changed the name of my worker in my workers.properties file. First I had my worker.list=ajp13, which is the default in server.xml, right? Then, I changed it to worker.list=test I did not change my server.xml file, but I thought you only specify for the listener. Maybe I am missing something. I am not aware of a jvm= parameter..where am I supossed to put this? "David O'Brien" <[EMAIL PROTECTED] To: "Tomcat Users List" <[EMAIL PROTECTED]> .org>cc: "Tomcat Users List" <[EMAIL PROTECTED]> Subject: RE: mod_jk worker help please!! 12/05/2003 11:20 AM Please respond to "Tomcat Users List" I see no jvm="workers83" in the sever.xml file ??? -Dave >Yes, I have that. So, why would it ignore my worker.list for the workers I >define? > >2003-12-04 17:16:58 Ajp13Connector[8009] Starting background thread >2003-12-04 17:16:58 Ajp13Processor[8009][0] Starting background thread >2003-12-04 17:16:58 Ajp13Processor[8009][1] Starting background thread >2003-12-04 17:16:58 Ajp13Processor[8009][2] Starting background thread >2003-12-04 17:16:58 Ajp13Processor[8009][3] Starting background thread >2003-12-04 17:16:58 Ajp13Processor[8009][4] Starting background thread > > > > > > > > > "Sullivan, > > Patrick" To: "Stephanie A > Bickel" <[EMAIL PROTECTED]>, > <[EMAIL PROTECTED] > <[EMAIL PROTECTED]> > > entura.Org>cc: > > Subject: RE: mod_jk > worker help please!! > 12/05/2003 > 09:56 > > AM > > Please respond > to > > "Tomcat > Users > > List" > > > > > > > > > >Check you tomcat logs for >Ajp13Connector[8883] Opening server socket on all host IP addresses >Ajp13Connector[8883] Starting background thread >Ajp13Processor[8883][0] Starting background thread >Ajp13Processor[8883][1] Starting background thread >Ajp13Processor[8883][2] Starting background thread >Ajp13Processor[8883][3] Starting background thread >Ajp13Processor[8883][4] Starting background thread > >My server.xml: > > > port="8380" minProcessors="5" maxProcessors="75" >enableLookups="true" redirectPort="8443" >acceptCount="100" debug="0" connectionTimeout="2" >useURIValidationHack="false" disableUploadTimeout="true" /> > port="8883" minProcessors="5" maxProcessors="75" >acceptCount="10" tomcatAuthentication="false" debug="0"/> > > > > autoDeploy="true"> > > > > > > >My workers.properties: >workers.apache_log=/usr/local/webservers/a2047d/logs >workers.catalina_home=/usr/local/webservers/t4129 >workers.java_home=/usr/java131 >ps=/ > ># Define 1 real worker using ajp13 >worker.list=worker83 > ># Set properties for worker83 (ajp13) >worker.worker83.type=ajp13 >worker.worker83.host=localhost >worker.worker83.port=8883 >worker.worker83.lbfactor=50 >worker.worker83.cachesize=10 >worker.worker83.cache_timeout=600 >worker.worker83.socket_keepalive=1 >worker.worker83.socket_timeout=300 > >My httpd.conf (part of it atleast): >... >Listen 172.29.222.160:83 > >#Compiled in modules: ># core.c ># mod_access.c ># mod_auth.c ># mod_auth_dbm.c ># mod_include.c ># worker.c ># http_core.c ># mod_mime.c ># mod_cgid.c ># mod_dir.c ># mod_alias.c ># mod_so.c >LoadModule auth_ldap_module modules/mod_auth_ldap.so >LoadModule jk_module modules/mod_jk.so > >User lawweb >... > ># Where to find worker
Re: Apache 2, Tomcat 4.1, RH 9 - servlet/jsp requests return only on second hit
At 09:18 AM 2/10/2004, Brent Parker wrote: My Config: Redhat 9, Apache 2.0.47, mod_jk 1.2.6, Tomcat 4.1.29 It takes a second request (to port 80) to get a jsp or servlet output to display in the browser: I type in the url (jsp or servlet) and hit Enter, the browser (Mozilla and IE) spins indefinitely. I then highlight the address line and hit Enter a second time, and the page will immediately load. Restated: All servlets/jsp requests do load - but only on the second hit (request). However, any static html page (served through apache) loads immediately on the first hit. I had this same problem and never could find a fix... I reverted back to 1.2.5 of the connectors and all was fine. -Dave The println's I put in the jsp/servlet reveal that they are getting hit on the first request, and they print out repeatedly (thus the browser spin) until I make the second request. To isolate tomcat: If I configure the server.xml, and hit the jsp/servlet through port 8080, it serves immediately. Maybe this isn't a tomcat problem, but since it does involve tomcat, I figured this forum would have the best shot at an answer. The apache (access_log, error_log), mod_jk, and catalina logs do not show any errors. The catalina_log.*.txt shows sporadic "IOException Broken pipe" errors. Any suggestions / advice would be appreciated. I suspect I have configured something wrong - I would be glad to forward/post my config files if it would help. I have been writing java apps for a couple of years - some deployed to tomcat standalone, but this is my first adventure into tomcat connected to apache. Thanks!! Brent - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] David G. O'Brien Web Services Coordinator / Systems Administrator NACCRRA The Nation's Network of Child Care Resource & Referral 1319 F Street NW, Suite 500 Washington, DC 20004 (202) 393-5501 ext. 113 (202) 393-1109 fax - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: done did not found a worker
If you are using mod_jk and NOT mod_jk2 then this file's content makes no difference in your configuration. You need to tell apache to use the workers.properties NOT the workers2.properties in your httpd.conf file -Dave At 11:58 AM 2/10/2004, you wrote: But Dave you didn't address this stuff below? I think this is where I'm having the most problems. ##= ##Other needed configuratoin(s) ##= ##define the shared memory file [shm] file=/usr/local/tomcat-4.1.24/work/jk2.shm file=1048576 ## Define the communication channel [channel.socket:localhost:8009] #tomcatId=localhost:8009 port=8009 host=127.0.0.1 #define the worker [balance_all_workers:localhost:8009] channel=channel.socket:localhost:8009 #Uri mapping [uri:saturn.temple.edu/examples/*] #worker=ajp13:localhost:8009 worker=balance_all_workers:localhost:8009 [uri:saturn.temple.edu/developers/*] #worker=ajp13:localhost:8009 worker=balance_all_workers:localhost:8009 [uri:saturn.temple.edu/product/*] #worker=ajp13:localhost:8010 worker=balance_all_workers:localhost:8010 [uri:saturn.temple.edu/uPortal/*] #worker=ajp13:localhost:8010 worker=balance_all_workers:localhost:8010 #[status:] #info=Status worker, displays runtime information channel=channel.socket:localhost:8009 #[uri:/status/*] #worker=status:localhost:8009 #group=status: David Rees wrote: Dwayne Ghant wrote, On 2/9/2004 7:02 PM: Dave, I have been having semular issues would it be impossible for to post the four files listed below: 1. http.conf 2. ssl.conf 3. server.xml 4. workers2.properties Here's a sample for setting up Apache. This will work on either Apache 2.0.X or Apache 1.3.X, and mod_jk 1.2.5. Any version of Tomcat will work, use the example connector config included with every default server.xml as it varies a little between Tomcat versions. httpd.conf # This only shows the portions relevant to mod_jk, you should stick the # lines somewhere in your config file. This config also works for # Apache 1.3.X as well as Apache 2.0.X. --- LoadModule jk_module modules/mod_jk.so JkWorkersFile /tomcat_workers.properties JkLogFile /mod_jk.log JkLogLevel error ServerName www.example.com JkMount /*.jsp tomcat JkMount /servlet/* tomcat --- /tomcat_workers.properties --- worker.list=tomcat worker.tomcat.port=8007 worker.tomcat.host=localhost worker.tomcat.type=ajp13 --- That's it! -Dave aka the mod_jk "expert" NOT a mod_jk2 "expert"! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Dwayne A. Ghant Application Developer Temple University 215.204. [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] David G. O'Brien Web Services Coordinator / Systems Administrator NACCRRA The Nation's Network of Child Care Resource & Referral 1319 F Street NW, Suite 500 Washington, DC 20004 (202) 393-5501 ext. 113 (202) 393-1109 fax - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: done did not found a worker
At 02:24 PM 2/10/2004, you wrote: On Mon, 2004-02-09 at 20:23, David OBrien wrote: > At 09:26 PM 2/9/2004, Nicholas Bernstein wrote: > >On Mon, 2004-02-09 at 17:37, David Rees wrote: > > > On Mon, February 9, 2004 at 4:41 pm, Charles Daniel wrote: > > > > > > > > Give up trying to use Apache2 with mod_jk. After spending days on the > > > > message boards trying to solve this one, I was ultimately told by the > > > > so-called "experts" that "I had a network configuration problem and that > > > > some process was likely to be either already using or blocking port > > 8009". > > > > > > Hmm, I've had no problems at all using mod_jk with Apache2 on both various > > > Linux and SGI Irix machines. I must be a so-called "expert". ;-) > > > > > > -Dave > > > >if you've got a minute, take a look @ the configs I posted > >http://nicholasbernstein.com/tomcat/ > > Are you using workers2.properties with mod_jk and not mod_jk2 ?? > > JkWorkersFile /etc/httpd/conf/workers2.properties > change to workers.properties Thanks, that was from a previous configuration that I forgot to edit when putting on the web. > > Also I have had to define a lvmroute in my server.xml that is the same name > as the named worker in your case ajp13 > Could you please clarify that? do you mean ajp13 somewhere in server.xml, or does it need to be in a specific place? I meant jvmroute sorry port="8009" minProcessors="50" maxProcessors="75" acceptCount="25" buffersize="16384" debug="0"/> <-- HERE -Dave > -Dave > > > >and let me know if you see anything wrong with the setup. I'd rather > >stick to apache2; i'm using redhat ES and it looks like they've made a > >lot of RH specific patches to httpd source, so it probably performs a > >lot better that compiling 1.x from source. > > > > > > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > >-- > >+---+ > >| Nicholas Bernstein| [EMAIL PROTECTED] | > >| UNIX Systems Administrator| http://www.docmagic.com | > >| Document Systems Inc. | | > >| gpg: F706 8C4E 78FA 53A0 019F D983 FE28 2002 D1F3| > >+---+ -- +---+ | Nicholas Bernstein| [EMAIL PROTECTED] | | UNIX Systems Administrator| http://www.docmagic.com | | Document Systems Inc. | | | gpg: F706 8C4E 78FA 53A0 019F D983 FE28 2002 D1F3| +---+ David G. O'Brien Web Services Coordinator / Systems Administrator NACCRRA The Nation's Network of Child Care Resource & Referral 1319 F Street NW, Suite 500 Washington, DC 20004 (202) 393-5501 ext. 113 (202) 393-1109 fax - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]