问题描述
我的应用程序正在使用的Apache
, MOD-JK
和的Tomcat
进行负载均衡,它正常工作与此 work.properties
:
My application is using Apache
,mod-jk
and Tomcat
for load balancing, which works fine with this work.properties
:
worker.list=workerlist
# Set properties for worker3
worker.worker3.type=ajp13
worker.worker3.host=xxxx
worker.worker3.port=xx
worker.worker3.lbfactor=4
worker.worker4.ping_mode=A
worker.worker3.socket_timeout=30
worker.worker3.reply_timeout=30000
# Set properties for worker4
worker.worker4.type=ajp13
worker.worker4.host=xxxx
worker.worker4.port=xx
worker.worker4.lbfactor=4
worker.worker4.ping_mode=A
worker.worker4.socket_timeout=30
worker.worker4.reply_timeout=30000
# Set properties for workerlist(lb)
worker.workerlist.type=lb
worker.workerlist.balance_workers=worker4,worker3
worker.workerlist.sticky_session=1
worker.list=jkstatus
worker.jkstatus.type=status
会发生什么事是,当我关闭 worker4
(Tomcat)的, JK状态管理器的Web界面
( )仍显示 worker4
是 ACT
和 OK / IDLE
国家,这是没有意义的,因为 worker4
不再可用。而且我没有看到任何错误消息中的 MOD-jk.log
。
What happens is that when I shutdown the worker4
(Tomcat), the web interface of JK Status Manager
(http://apachehost/jkstatus) still shows the worker4
is in ACT
and OK/IDLE
State, which makes no sense because the worker4
is no longer available. And I don't see any error message in the mod-jk.log
.
然而,当我修改 worker.properties
再次仅具有不可用 worker4
并尝试访问时,页面显示了 ERR
Satte:
However, when I change the worker.properties
to have only the unavailable worker4
and try access again, the page shows the ERR
Satte:
的 MOD-jk.log
显示:
[error] ajp_service::jk_ajp_common.c (2626): (worker4) connecting to tomcat failed.
[info] service::jk_lb_worker.c (1400): service failed, worker worker4 is in error state
[info] service::jk_lb_worker.c (1480): All tomcat instances are busy or in error state
[error] service::jk_lb_worker.c (1485): All tomcat instances failed, no more workers left
我的问题是:
-
根据,它说:确定(空闲):该工人没有收到自上次平衡器维护的任何请求默认情况下均衡运行维护每60秒的工人应该是好的,但因为我们没有使用它。一段时间后,我们不能肯定。这种状态被称为N / A 1.2.24版本之前。。我从这个理解是MOD-JK本身就自动保持连接。那么,为什么不是
JK状态管理器
给我警告,如果工人的人下来?请问维修不能正常工作或JK状态管理器
网站无法正常工作?
According to Service Availablity Rating on Tomcat's website, it says "OK (idle): This worker didn't receive any request since the last balancer maintenance. By default balancer maintenance runs every 60 seconds. The worker should be OK, but since we didn't have to use it for some time, we can't be sure. This state has been called N/A before version 1.2.24.". What I understand from this is mod-jk itself would maintain the connection automatically. So why not the
JK Status Manager
give me alert if one of the worker is down? Does the maintenance not work or theJK Status Manager
website not work properly?
除了 JK状态管理器
,有没有其他的方式来监控员工的实时状态?我的意思是,如果一台服务器宕机,我想立刻知道。
Besides JK Status Manager
, is there other way to monitor the status of workers in real time? I mean if one server is down, I'd like to know immediately.
请问 ping_mode
已被明确设置?是不是默认的A?日志说: [提醒] jk_map_handle_duplicates :: jk_map.c(446):检测到重复键'worker.worker4.ping_mode' - previous值'A'将与'A'覆盖
Does the ping_mode
have to be set explicitly?Is it default "A"? The log said that:[warn] jk_map_handle_duplicates::jk_map.c (446): Duplicate key 'worker.worker4.ping_mode' detected - previous value 'A' will be overwritten with 'A'.
推荐答案
1)如果一个人的Tomcat worker失败了,什么也没发生,直到你的平衡器的下一个检查。因此显示OK /空闲。 60秒后它应该变成错误状态。
1) If one Tomcat worker fails, nothing is happening until the next check of your balancer. Therefore OK/Idle is displayed. After 60 seconds it should turn into Err state.
2)有肯定的其他工具和网页只是一个信息,并没有形成管理。最简单的方法是建立一个servlet,即反应HTTP_200状态。您可以检查其可用性,即与URL对象,从外部程序。
2) There are for sure other tools and that page is just an info and not form management. The easiest way would be to set up a servlet, that responses HTTP_200 status. You can check its availability i.e. with an URL object, from an external program.
3),显示该消息,因为你必须在你的配置在第7行(worker4而不是worker3)一个错字:
3) That message is displayed, because you have a typo in your config in line 7 (worker4 instead of worker3):
worker.worker4.ping_mode=A
这篇关于mod_jk1.2.32的JK状态管理器(状态工人)不显示在Web界面上工人的正确状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!