使用Apache mod_jk.c加载平衡(3791):缺少localhost的uri映射

时间:2015-01-06 10:23:02

标签: tomcat

对于要求,我需要为Web应用程序进行负载平衡。

我正在努力解决以下问题。请参阅日志

[Tue Jan 06 15:20:06 2015] [10548:14728] [debug] jk_shm_attach::jk_shm.c (337): Attached shared memory memory [1] size=3072 free=0 addr=0x50aa80
[Tue Jan 06 15:20:06 2015] [10548:14728] [debug] jk_child_init::mod_jk.c (3266): Initialized mod_jk/1.2.40
[Tue Jan 06 15:20:55 2015] [10548:11696] [debug] jk_translate::mod_jk.c (3623): missing uri map for localhost:/eimsgoed
[Tue Jan 06 15:20:55 2015] [10548:11696] [debug] jk_map_to_storage::mod_jk.c (3791): missing uri map for localhost:/eimsgoed
[Tue Jan 06 15:21:56 2015] [10548:11696] [debug] jk_translate::mod_jk.c (3623): missing uri map for localhost:/eimsgoed
[Tue Jan 06 15:21:56 2015] [10548:11696] [debug] jk_map_to_storage::mod_jk.c (3791): missing uri map for localhost:/eimsgoed

/ eimsgoed是我在tomcat实例中部署的应用程序。

请参阅我的workers.properties文件

=============================

worker.list=balancer

worker.tomcat1.type=ajp13
worker.tomcat1.port=9004
worker.tomcat1.host=localhost

worker.tomcat2.type=ajp13
worker.tomcat2.port=9024
worker.tomcat2.host=localhost

worker.tomcat3.type=ajp13
worker.tomcat3.port=9012
worker.tomcat3.host=localhost


worker.balancer.type=lb
worker.balancer.balance_workers=tomcat1,tomcat2,tomcat3

worker.list=jkstatus
worker.jkstatus.type=status

我的httpd.conf文件

=============

LoadModule jk_module modules/mod_jk.so

# Path to workers.properties
JkWorkersFile conf/workers.properties

# Path to jk logs
JkLogFile logs/mod_jk.log

# Jk log level [debug/error/info]
JkLogLevel debug

# Jk log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

# JkOptions for forwarding
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"



JkMount /eimsgoed balancer
JkMount /status jkstatus 

我所有3个tomcat实例的server.xml

==============================

tomcat 1实例

<!-- Define an AJP 1.3 Connector on port 8009 -->
 <Connector port="9004" protocol="AJP/1.3" redirectPort="9003" />

 <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat1">

tomcat 2实例

<!-- Define an AJP 1.3 Connector on port 8009 -->
 <Connector port="9024" protocol="AJP/1.3" redirectPort="9023" />
 <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat2">

tomcat 3实例

<!-- Define an AJP 1.3 Connector on port 8009 -->
 <Connector port="9012" protocol="AJP/1.3" redirectPort="9011" />

 <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat3">

我在URI中出错的地方?

[Tue Jan 06 15:21:56 2015] [10548:11696] [debug] jk_map_to_storage::mod_jk.c (3791): missing uri map for localhost:/eimsgoed

有关信息,我使用的是Tomcat 7,Apache HTTP Server 2.4.10和Tomcat Mod_JK连接器1.2.40,Windows 7操作系统

请就此问题向我提出建议。

1 个答案:

答案 0 :(得分:0)

我在配置中看不到任何错误。可能是Apache 2.4和JK的问题。

还有另一种使用mod_proxy配置负载均衡器的方法:

https://serverfault.com/questions/604615/apache-mod-proxy-balancer-tomcat-load-balancing-should-not-redirect-until-we

在这里:

http://chandank.com/application-server/tomcat/tomcat-load-balancer-using-mod-proxy-and-session-sticky