aspose file tools*
The moose likes Tomcat and the fly likes Apache 2.x + Tomcat 4.x + Load Balancing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Apache 2.x + Tomcat 4.x + Load Balancing" Watch "Apache 2.x + Tomcat 4.x + Load Balancing" New topic
Author

Apache 2.x + Tomcat 4.x + Load Balancing

Narsimha Manekar
Ranch Hand

Joined: Mar 05, 2001
Posts: 35
Hi all
I have used following links to load balance two instances of tomcats on same server + redirect JSP requests from Apache 2.0 to Tomcats.

I have configured based on notes provided at
http://raibledesigns.com/tomcat/

(if you cannot get above site, go to http://www.ubeans.com/tomcat/index.html It is same as above but for Apache 1.3.x)

Above two articles contains step by step instructions for configuring an Apache 2.0 and 1.3.23 web servers respectively which handles static content and delegates JSP (Java Server Pages) and Servlet requests to two Tomcat 4.0.2 Beta2 servers using AJP 13 connectors and a load balancing worker.

java version: J2SDK 1.4.2
Linux version: SuSE 9.0 profession Enterprise Edition
Linux kernel version: 2.4.21-144-smp4G
Tomcat 4.0.6 - Two instances of Tomcat load balanced on same server
Apache 2.0.48
JSP applications using MySQL database, which is running on different server.

With this configuration our werbsite is working fine. We were able to browse both static html and jsp/servlet pages without any problem.
But, in mod_jk.log file we are getting a whole lot of error messages, kind of similar error messages repeating over and over again. Since, JSP pages were served without any problem we have ignored these messages. But in last month our web server crashed twice. Hence, we started digging into this problem.
Ours is a very busy website. It gets serveral million hits per month. But I could replicate the same problem on pre-production server.

Could any one help us clearing these error messages.

Thank you.

Rao Manekar

/**********************
ERROR generated in mod_jk.log
/***********************
[jk_connect.c (203)]: jk_open_socket, connect() failed errno = 111
[jk_ajp_common.c (676)]: Error connecting to tomcat. Tomcat is probably not started or is listenning on the wrong port. Failed errno = 111
[jk_ajp_common.c (955)]: Error connecting to the Tomcat process.
[jk_ajp_common.c (1309)]: sending request to tomcat failed in send loop. err=0
[jk_connect.c (203)]: jk_open_socket, connect() failed errno = 111
[jk_ajp_common.c (676)]: Error connecting to tomcat. Tomcat is probably not started or is listenning on the wrong port. Failed errno = 111
[jk_ajp_common.c (955)]: Error connecting to the Tomcat process.
[jk_ajp_common.c (1309)]: sending request to tomcat failed in send loop. err=1
[jk_connect.c (203)]: jk_open_socket, connect() failed errno = 111
[jk_ajp_common.c (676)]: Error connecting to tomcat. Tomcat is probably not started or is listenning on the wrong port. Failed errno = 111
[jk_ajp_common.c (955)]: Error connecting to the Tomcat process.
[jk_ajp_common.c (1309)]: sending request to tomcat failed in send loop. err=2
[jk_ajp_common.c (1318)]: Error connecting to tomcat. Tomcat is probably not started or is listening on the wrong port. Failed errno = 111
*************************/

[ June 14, 2004: Message edited by: NARSIMHA MANEKAR ]
[ June 14, 2004: Message edited by: NARSIMHA MANEKAR ]
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

The exact line numbers don't match, but perhaps it's a minor version difference in our jk's.

http://marc.theaimsgroup.com/?l=tomcat-user&m=106693633221107&w=2

Seems like jk is very verbose in its logging. It also seems that (like your case), the 'errors' can't be matched back up to any client-visible errors.

This type of question ("why does jk produce these error messages?") is very commonly seen on tomcat-user. They usually get the response that mine did (ie: none).
Narsimha Manekar
Ranch Hand

Joined: Mar 05, 2001
Posts: 35
Thank you Mike.
Your reply was quite helpful.
I came to know that
/******************/
[jk_ajp_common.c (1303)]: ERROR: Client connection aborted or network
problems

Which I understand. Someone clicked 'stop' on the browser.
/*********************/
Our maxProcessors and maxClient are different. I will match those two and see if it would make any change. As I mentioned earlier ours is a very busy site.
I am not that much worried about the logs messages, but recently our server crashed twice. Also we are getting some 500 (Internal Server Error) messages in access_log file. It is still a mistery to us.

Thank you

-rao
Narsimha Manekar
Ranch Hand

Joined: Mar 05, 2001
Posts: 35
Hi all
I happened to check Tomcat log files catalina_log.XXX.txt, they were filled with following error
/*********************************/
2004-05-01 04:50:11 Ajp13Connector[11009] No processor available, rejecting this connection
/*********************************/
I immediately increased maxProcessor value from 75 to 200 in Tomcat's server.xml file and set the same value to MaxClients in Apache's httpd.conf file.

Now my catalina_log.XXX.txt file is little cleaner. I could narrow down to few error messages:

in Tomcat's catalina_log.XXX.txt file I am getting
-----------------------------------------------------
2004-05-01 02:52:56 Ajp13Processor[11009][64] process: invoke
java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at org.apache.ajp.Ajp13.send(Ajp13.java:525)
at org.apache.ajp.RequestHandler.finish(RequestHandler.java:501)
at org.apache.ajp.Ajp13.finish(Ajp13.java:395)
at org.apache.ajp.tomcat4.Ajp13Response.finishResponse(Ajp13Response.java:196)
at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:464)
at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:551)
at java.lang.Thread.run(Thread.java:534)
/******************************************************************/

in Apache's mod_jk.log file I am getting
-----------------------------------------------------
1)
[Mon Jun 14 10:24:10 2004] [jk_uri_worker_map.c (595)]: In jk_uri_worker_map_t:
:map_uri_to_worker, wrong parameters

and
2)
[Mon Jun 14 10:25:12 2004] [jk_ajp_common.c (1052)]: ERROR sending data to client. Connection aborted or network problems
[Mon Jun 14 10:25:12 2004] [jk_ajp_common.c (1303)]: ERROR: Client connection a borted or network problems


I appreciate any help on this.

-rao
[ June 14, 2004: Message edited by: NARSIMHA MANEKAR ]
Narsimha Manekar
Ranch Hand

Joined: Mar 05, 2001
Posts: 35
I got answer at
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4663
look at
-- Additional Comments From Glenn Nielsen 2004-01-08 13:23 -------


Now I am left over with explanation to one error message:

in Apache's mod_jk.log file I am getting
-----------------------------------------------------
[Mon Jun 14 10:24:10 2004] [jk_uri_worker_map.c (595)]: In jk_uri_worker_map_t:
:map_uri_to_worker, wrong parameters


- rao
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Apache 2.x + Tomcat 4.x + Load Balancing
 
Similar Threads
Errors with Apache/Tomcat server setup
Problem connecting to tomcat via Apache..........
Loadbalancing issues
tomcat5.5.27+apache2.2.4+mod_jk-1.2.28-httpd-2.2.3.so
Tomcat Apache connector - beginner's question