Apache httpd 2.2.x + mod_jk 1.2.30 + tomcat 6 错误:找不到名为“XXXXX”的工作人员在 uri 地图后处理中
我在使用两个 Tomcat 实例设置负载均衡器时收到以下错误:
[信息] mod_jk.c (3189): mod_jk/1.2.30 已初始化 [错误] jk_uri_worker_map.c (506): 在 uri 映射后处理中找不到名为“loadmanager”的工作程序。
以下是我的配置设置:
httpd.conf 更改
# Include mod_jk configuration file
Include conf/mod_jk.conf
mod_jk.confworkers.properties
LoadModule jk_module modules/mod_jk.so
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"
JkMount /TestLB1/ loadmanager
JkMount /TestLB1/* loadmanager
JkShmFile logs/jk.shm
。
worker.list=loadmanager
worker.tomcat1.port=18081
worker.tomcat1.host=localhost
worker.tomcat1.type=ajp13
worker.tomcat1.lbfactor=1
worker.tomcat2.port=28081
worker.tomcat2.host=localhost
worker.tomcat2.type=ajp13
worker.tomcat2.lbfactor=1
worker.loadmanager.type=lb
worker.loadmanager.balance_workers=tomcat1,tomcat2
worker.loadmanager.sticky_session=True
在 Tomcat 的 server.xml 中,我也将 jvmRoute 属性设置为 Engine
<Engine defaultHost="localhost" name="Catalina" jvmRoute="tomcat1">
<Engine defaultHost="localhost" name="Catalina" jvmRoute="tomcat2">
两个 Tomcat 实例都已启动并运行良好,并且 AJP 端口 18081 和 18081 端口均正常运行 分别为28081。
但是在启动 Apache httpd.exe 时,mod_jk 日志文件总是显示上述错误,并且当我尝试通过 http 访问我的 Web 应用程序时: //localhost/TestLB1 什么也没出现。
有什么解决办法吗?
I am getting the following error while setting up the load balancer with two Tomcat instances:
[info] mod_jk.c (3189): mod_jk/1.2.30 initialized
[error] jk_uri_worker_map.c (506): Could not find worker with name 'loadmanager' in uri map post processing.
Following are my configuration settings:
httpd.conf changes
# Include mod_jk configuration file
Include conf/mod_jk.conf
mod_jk.conf
LoadModule jk_module modules/mod_jk.so
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"
JkMount /TestLB1/ loadmanager
JkMount /TestLB1/* loadmanager
JkShmFile logs/jk.shm
workers.properties
worker.list=loadmanager
worker.tomcat1.port=18081
worker.tomcat1.host=localhost
worker.tomcat1.type=ajp13
worker.tomcat1.lbfactor=1
worker.tomcat2.port=28081
worker.tomcat2.host=localhost
worker.tomcat2.type=ajp13
worker.tomcat2.lbfactor=1
worker.loadmanager.type=lb
worker.loadmanager.balance_workers=tomcat1,tomcat2
worker.loadmanager.sticky_session=True
In Tomcat's server.xml I have set the jvmRoute attribute to Engine also
<Engine defaultHost="localhost" name="Catalina" jvmRoute="tomcat1">
<Engine defaultHost="localhost" name="Catalina" jvmRoute="tomcat2">
Both the Tomcat instances are up and running fine with AJP ports 18081 & 28081 respectively.
But while starting the Apache httpd.exe the mod_jk log files always shows the above error, and when I try to access my web app through http://localhost/TestLB1 nothing comes up.
Any Solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
遇到问题了....
问题在于我正在编辑worker.properties 文件的文本编辑器,它向文件添加了一些特殊字符。
当我仅在记事本中打开文件时,我找到了它们。
删除所有不需要的字符后,一切都很完美。
Got the problem....
Issues is with the text editor in which i was editing my worker.properties file , it adds few special chars to files.
I found them when i opend the files in notepad only.
After removing all unwanted chars everythings works perfect.
使用notepad++等优秀的文本编辑器创建worker.properties文件。不这样做可能会添加一些看不见的特殊字符,并且workers.properties文件将无法被mod_jk解析。
Create your worker.properties file with a good text editor like notepad++. Not doing so may add some unseen special characters and workers.properties file wont parse by mod_jk.