apache+tomcatf负载中的RPC服务问题!
本人使用apache+tomcat+mod_jk.so来实现负载均衡(apache-tomcat-6.0.16.tar.gz;httpd-2.2.8.tar.gz;tomcat-connectors-1.2.26).
用户登录系统后,没有几秒钟,IE浏览器就弹出“Connection failed”错误提示。同时在Apache日志里会出现如下错误(他tomcat日志里没有错误):
[Mon Nov 24 17:04:07 2008] [5494:3085997824] [warn] map_uri_to_worker::jk_uri_worker_map.c (60: Uri * is invalid. Uri must start with /
[Mon Nov 24 17:04:07 2008] [5494:3085997824] [debug] jk_translate::mod_jk.c (3147): no match for * found
问过了开发人员,说是连接RPC服务出现了问题。个人分析是apache在转发rpc服务时出现了问题(图片网页等转发都没有问题),可实在找不到错误日志里所说的Uri是在何处配置的,在网上找了半天,也都没有一个解决办法,不知道有没有人遇到过这样的问题,请帮忙解答一下,万分感谢!
下面关于httpd.conf的文件里相关的配置abce 为项目名称)
JkMount /abcd/servlet/* loadbalancer
JkMount / abcd /application/* loadbalancer
JkMount / abcd /* loadbalancer
JkMount / abcd /*.* loadbalancer
JkMount / abcd /JSON-RPC/* loadbalancer
以下是workers.properties 里相关配置
#workers.properties
# In Unix, we use forward slashes:
#ps=/
# list the workers by name
worker.list=loadbalancer,status
# ------------------------
# First tomcat server
# ------------------------
worker.tomcat1.port=8009
worker.tomcat1.host=xxx.xxx.xxx.xxx
worker.tomcat1.type=ajp13
worker.tomcat1.cachesize=10
worker.tomcat1.cache_timeout=600
worker.tomcat1.socket_timeout=600
worker.tomcat1.socket_keepalive=1
worker.tomcat1.local_worker=1
# 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=8009
worker.tomcat2.host=xxx.xxx.xxx.xxx
worker.tomcat2.type=ajp13
worker.tomcat2.cachesize=10
worker.tomcat2.cache_timeout=600
worker.tomcat2.socket_timeout=600
worker.tomcat2.socket_keepalive=1
worker.tomcat2.local_worker=1
#
# 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
worker.loadbalancer.sticky_session=true
#worker.loadbalancer.sticky_session_force=true
#
worker.status.type=status
#
# END workers.properties
本人刚刚接触apache,以上的配置文件如果还有在优化改进的地方,也请各位能指出来,谢谢各位了!