Mod_Jk负载均衡

时间:2016-08-08 22:50:57

标签: apache tomcat load-balancing mod-jk

我尽一切可能使Mod_jk无法正常工作。我尝试了多次Apache下载,尝试了我能找到的每个建议,包括检查特殊字符...... Apache和Tomcat都按预期工作但仍然没有负载平衡,我不断收到这些错误消息。有什么想法吗?

[1640:3636] [info] init_jk::mod_jk.c (3383): mod_jk/1.2.40 initialized
[1640:3636] [error] extension_fix::jk_uri_worker_map.c (578): Could not find worker with name 'LoadBalancer' in uri map post processing.
[1640:3636] [error] extension_fix::jk_uri_worker_map.c (578): Could not find worker with name 'jk-status' in uri map post processing.

我在Windows 32位上使用Apache 2.4.23和Mod_Jk 1.2.4。

在Httpd.conf中:

Listen 10.x.x.x:80
LoadModule jk_module modules/mod_jk.so
<IfModule jk_module>
        JkWorkersFile conf/workers.properties

        JkShmFile logs/mod_jk.shm
        JkLogFile logs/mod_jk.log
        JkLogLevel info

        JkWatchdogInterval 60

        <Location /jk-status>
            JkMount jk-status
            Order deny,allow
            Deny from all
            Allow from 10.4.81.62
        </Location>

        <Location /jk-manager>
            JkMount jk-manager
            Order deny,allow
            Deny from all
            Allow from 10.4.81.62
        </Location>


        # Configure applications
        JkMount /Geoserver/* LoadBalancer

</IfModule>

在workers.properties中:

workers.list=jk-status
worker.jk-status.type=status

worker.list=jk-manager
worker.jk-manager.type=status

workers.list=LoadBalancer
worker.LoadBalancer.type=lb
worker.balancer.error_escalation_time=0
worker.balancer.max_reply_timeouts=10

worker.worker1.type=ajp13
worker.worker1.host=10.x.x.x
worker.worker1.port=8009
worker.worker1.lbfactor=1
worker.worker1.activation=A
worker.worker1.socket_connect_timeout=5000
worker.worker1.socket_keepalive=true

worker.worker2.type=ajp13
worker.worker2.host=10.x.x.x
worker.worker2.port=8010
worker.worker2.lbfactor=1
worker.worker2.activation=A
worker.worker2.socket_connect_timeout=5000
worker.worker2.socket_keepalive=true

worker.LoadBalancer.balance_workers=worker1,worker2

在Tomcat-1 server.xml中:

  <Engine name="Catalina" defaultHost="10.x.x.x" jvmRoute="worker1">     
  <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>

在Tomcat-2 server.xml中:

  <Engine name="Catalina" defaultHost="10.x.x.x" jvmRoute="worker2">     
  <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>

1 个答案:

答案 0 :(得分:0)

workers.list=LoadBalancer 文件中存在单字符错误:

worker.list=LoadBalancer

应该是:

jk-status

{{1}}工作人员遇到同样的问题。

(对不起,你已经为此而自杀了。)