简体   繁体   English

mod_jk 如何处理节点故障

[英]How mod_jk handling node failure

We have configured mod_jk with two tomcat servers with 2 apache web servers.我们已经为 mod_jk 配置了两个 tomcat 服务器和 2 个 apache web 服务器。 We wanted to know how mod_jk handling node failure or how it will do a health check.?我们想知道 mod_jk 如何处理节点故障或如何进行健康检查。?

You can use a watchdog by setting the JkWatchdogInterval directive.您可以通过设置JkWatchdogInterval指令来使用看门狗。 From the documentation :文档

This directive configures the watchdog thread interval in seconds.该指令以秒为单位配置看门狗线程间隔。 The workers are maintained periodically by a background thread running periodically every watchdog_interval seconds.工人由后台线程定期维护,每隔 watchdog_interval 秒定期运行。 Worker maintenance checks for idle connections, corrects load status and is able to detect backend health status.工作人员维护检查空闲连接,纠正负载状态并能够检测后端健康状态。 The maintenance only happens, if since the last maintenance at least worker.maintain seconds have passed.维护只会发生,如果自上次维护以来至少已经过去了 worker.maintain 秒。 So setting the JkWatchdogInterval much smaller than worker.maintain is not useful.所以将 JkWatchdogInterval 设置得比 worker.maintain 小很多是没有用的。

The default value is 0 seconds, meaning the watchdog thread will not be created, and the maintenance is done in combination with normal requests instead.默认值为0秒,表示不会创建看门狗线程,而是结合正常请求进行维护。

In Advanced Worker Directives, use "redirect", this will Set to the name of the preferred failover worker.在 Advanced Worker Directives 中,使用“redirect”,这将设置为首选故障转移工作器的名称。 Eg : worker.server-four.redirect=server-two例如:worker.server-four.redirect=server-two

If worker matching SESSION ID is in error state then the redirect worker will be used instead.如果与会话 ID 匹配的工作线程处于错误状态,则将使用重定向工作线程。

This feature has been added in jk 1.2.9.此功能已在 jk 1.2.9 中添加。

Status of mod_jk mod_jk 的状态

Please add the below tag in mod_jk.conf file请在 mod_jk.conf 文件中添加以下标签

JkMount status Order deny,allow Deny from all Allow from 127.0.0.1 JkMount 状态 Order deny,allow Deny from all Allow from 127.0.0.1

Then you can find the status of mod_jk by using below URL然后你可以使用下面的 URL 找到 mod_jk 的状态

http://webserverIP:port(from httpd.conf)/status http://webserverIP:port(来自httpd.conf)/status

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM