tomcat 使用Apache mod_jk. c进行负载平衡(3791):缺少本地主机的URIMap

yi0zb3m4  于 2022-11-13  发布在  Apache
关注(0)|答案(3)|浏览(151)

作为一个需求,我需要为一个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服务器2.4.10和Tomcat Mod_JK连接器1.2.40、Windows 7操作系统
请在这个问题上指点我。

jjhzyzn0

jjhzyzn02#

我遇到了同样的问题,而且我的配置几乎与您相同。
我在httpd.conf文件中添加了VirtualHostMap,它就开始工作了。

<VirtualHost *:443>
  ServerName localhost
  JKMount /TCSession/* lb
</VirtualHost>
von4xj4u

von4xj4u3#

这与在VirtualHost中指定JKMount时给出的答案基本相同,但您可以只指定JKMountCopy= On,而不是复制相同的配置。

<VirtualHost _default_:443>
    DocumentRoot "${SRVROOT}/htdocs"
    ServerAdmin admin@example.com
    ErrorLog "${SRVROOT}/logs/error.log"
    TransferLog "${SRVROOT}/logs/access.log"
    SSLEngine on
    ...
    JkMountCopy On
</VirtualHost>

问题是,虚拟主机不会继承此配置,您必须指定此指令来继承它。

相关问题