3

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?

f_puras
  • 2,521
  • 4
  • 33
  • 38
PushkarT
  • 157
  • 1
  • 3
  • 12

2 Answers2

4

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.

PushkarT
  • 157
  • 1
  • 3
  • 12
  • 1
    +1 I was trying to follow along the JBoss AS clustering guide and kept seeing the same error. It seems the mod_jk code running on a windows box was quietly failing to parse the workers.properties file because it wanted to see CRLFs at the end of lines instead of just CRs. But instead of reporting a parsing error, it just vaguely says something is wrong with my configuration. – dave thompson Sep 19 '12 at 22:38
  • Hi Pushkar, you mean notepad on Windows? Where were these special chars, at the end or among the lines? – elect Feb 15 '14 at 09:06
  • yes on windows notepad spl chars were at the end of the lines. – PushkarT May 20 '14 at 19:00
0

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.