2

I tried everything possible to make Mod_jk work with no success. I tried multiple Apache downloads, tried every recommendation I could find including checking for special characters... both Apache and Tomcat are working as anticipated but still no load balancing and I keep getting these error messages. Any idea?

[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.

I am using Apache 2.4.23 and Mod_Jk 1.2.4 both for Windows 32 bit.

in 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>

in 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

in Tomcat-1 server.xml:

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

in Tomcat-2 server.xml:

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

1 Answers1

2

You have a single-character error in your workers.properties file:

workers.list=LoadBalancer

should be:

worker.list=LoadBalancer

You have the same problem with the jk-status worker.

(Sorry you've been killing yourself over this.)

Christopher Schultz
  • 20,221
  • 9
  • 60
  • 77
  • Man, you are the best. Another proof that we are human. Well done. – JoeThomas Aug 10 '16 at 23:15
  • As a matter of fact, is there any debugger someone can use to avoid silly mistakes? – JoeThomas Aug 10 '16 at 23:17
  • You can enable TRACE-level logging for `mod_jk`, but it will only tell you what it's doing, not what it's NOT doing. The error message `Could not find worker with name 'LoadBalancer'` was the key to the issue. If the worker isn't in the map, it's because it's not being loaded, or the `JkWorkersFile` isn't in the right place in the config file. – Christopher Schultz Aug 11 '16 at 03:01