tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jorge Medina <jmed...@e-dialog.com>
Subject RE: Problem forward HTTP / Soap request using mod_jk
Date Wed, 04 Nov 2009 20:15:16 GMT
Did you add a "load blancer worker" to your workers.properties? 

Below is what I use to perform load balancing over two Tomcat servers.

I have a similar scenario: Apache in front of two (or more Tomcats). 
Apache forwards the requests using mod_jk. 
My client is sending SOAP requests using Axis2.



worker.list= wlb, jkwatch
##############################################################################
# Defining a load balancer worker
##############################################################################
worker.wlb.type=lb
worker.wlb.balance_workers=tomcatserver1, tomcatserver2
worker.wlb.max_reply_timeouts=3
# worker.wlb.retries=2
# worker.wlb.retry_interval=100
# worker.wlb.sticky_session=True
# worker.wlb.sticky_session_force=False
# worker.wlb.method=Request
# worker.wlb.lock=Optimistic

##############################################################################
# Defining the status workers
##############################################################################
# A read-only status worker
worker.jkwatch.type=status
worker.jkwatch.read_only=True
worker.jkwatch.mount=/private/admin/watch/jk
# A managing status worker
# worker.jkmanage.type=status
# worker.jkmanage.mount=/private/admin/manage/jk
##############################################################################
## Balanced Workers (Tomcat Workers)
##############################################################################
##############################################################################
# Tomcat Worker (tomcatserver1)
##############################################################################
worker.tomcatserver1.type=ajp13
worker.tomcatserver1.host=localhost
worker.tomcatserver1.port=8009
worker.tomcatserver1.lbfactor=1
# Connection pool timeout is set in seconds. (10 minutes). If you modify this
# value, you need to modify the AJP connector in the Tomcat server.xml to
# match this value. Note that the value in Tomcat must be specified in milliseconds.
worker.tomcatserver1.connection_pool_timeout=600
worker.tomcatserver1.socket_keepalive=True
worker.tomcatserver1.socket_timeout=60
## worker.tomcatserver1.socket_connect_timeout=60
#
# Apache will wait 30 seconds (30,000 ms) for Tomcat to respond, otherwise
# it will return error "504 - Gateway timeout" to the client
worker.tomcatserver1.reply_timeout=30000
#
# This recovery_options attribute is a bit mask.
# The following bits are allowed:
#  1: don't recover if Tomcat failed after getting the request
#  2: don't recover if Tomcat failed after sending the headers to client
#  4: close the connection to Tomcat, if we detect an error when writing back the answer to
the client (browser)
#  8: always recover requests for HTTP method HEAD (even if Bits 1 or 2 are set)
# 16: always recover requests for HTTP method GET (even if Bits 1 or 2 are set)
# We will set it to 27, equivalent to the binary 11011
worker.tomcatserver1.recovery_options=27
##############################################################################
# Tomcat Worker (tomcatserver2)
##############################################################################
worker.tomcatserver2.type=ajp13
worker.tomcatserver2.host=localhost
worker.tomcatserver2.port=7009
worker.tomcatserver2.lbfactor=1
# Connection pool timeout is set in seconds. (10 minutes). If you modify this
# value, you need to modify the AJP connector in the Tomcat server.xml to
# match this value. Note that the value in Tomcat must be specified in milliseconds.
worker.tomcatserver2.connection_pool_timeout=600
worker.tomcatserver2.socket_keepalive=True
worker.tomcatserver2.socket_timeout=60
## worker.tomcatserver2.socket_connect_timeout=60
#
# Apache will wait 30 seconds (30,000 ms) for Tomcat to respond, otherwise
# it will return error "504 - Gateway timeout" to the client
worker.tomcatserver2.reply_timeout=30000
#
# This recovery_options attribute is a bit mask.
# The following bits are allowed:
#  1: don't recover if Tomcat failed after getting the request
#  2: don't recover if Tomcat failed after sending the headers to client
#  4: close the connection to Tomcat, if we detect an error when writing back the answer to
the client (browser)
#  8: always recover requests for HTTP method HEAD (even if Bits 1 or 2 are set)
# 16: always recover requests for HTTP method GET (even if Bits 1 or 2 are set)
# We will set it to 27, equivalent to the binary 11011
worker.tomcatserver2.recovery_options=27










-----Original Message-----
From: breako [mailto:alex.staveley@fineos.com] 
Sent: Tuesday, November 03, 2009 1:35 PM
To: users@tomcat.apache.org
Subject: Problem forward HTTP / Soap request using mod_jk


Hi,
I have two tomcat servers and I can make them talk to each other using soap / http no problem.

However, when I put Apache infront of one my tomcat servers and set it up to forward http
requests to the tomcat server it doesn't get any requests.

I am using the mod_jk to achieve the forwarding. I have tested other types of http forwarding,
and they are all ok. 

So I am confident, I have my workers.properties, ajp ports etc set up ok.

I am getting no error messages in my mod_jk logfile.

I wonder can mod_jk only forward only certain types of http requests?

Any ideas?

Apache Http Server: Apache/2.0.47
Tomcat Version: Tomcat/5.5.12

I have to use these versions for the project I am working on.

thanks.

httpd.conf

...

# Load the jk module.
LoadModule jk_module modules/mod_jk.so

# Specify the workers.properties file location # This is where the tomcat instances are defined
JkWorkersFile conf/workers.properties
JkLogFile     logs/mod_jk.log
JkLogLevel    error
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkRequestLogFormat "%B %H %r %s %w %V %T"

# Set up the URLs for request forwarding.
JkMount /HelloWorld/* worker2
JkMount /* worker2
JkMount /docy worker2

Workers.properties

...
# Define 1 real worker using ajp13
worker.list=worker2

# Set properties for worker2 (ajp13)
worker.worker2.type=ajp13
worker.worker2.host=localhost
worker.worker2.port=23009
worker.worker2.lbfactor=1

Cheers




--
View this message in context: http://old.nabble.com/Problem-forward-HTTP---Soap-request-using-mod_jk-tp26160709p26160709.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message