0

I tried implementing load balancing using mod_jk with two tomcat instance.

It holds good except for the case of spring security check. When i try using j_spring securitycheck. it is not working. Upon googling, this is what was the solution provided.

LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_module modules/mod_proxy.so
ProxyPass /j_spring_security_check ajp://localhost:8009/j_spring_security_check
ProxyPass /j_spring_security_logout ajp://localhost:8009/j_spring_security_logout

When i use the above it is working. But the problem is, I will not be able to refer the second tomcat instance.

httpd.conf :Configurations are

LoadModule jk_module modules/mod_jk.so
JkWorkersFile conf/workers.properties
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkLogFile logs/mod_jk.log
JkMount /restservice/* lb
JkMount /images/* lb

<Location /jkmanager/>
  JKMount jkstatus
  Order deny,allow    
  Allow from all
</Location>

Worker File :

worker.list=lb
worker.worker1.port=8009
worker.worker1.host=localhost
worker.worker1.type=ajp13


worker.worker2.port=8070
worker.worker2.host=localhost
worker.worker2.type=ajp13



worker.lb.type=lb
worker.lb.balance_workers=worker1,worker2

worker.list=jkstatus
worker.jkstatus.type=status
worker.loadbalancer.sticky_session=TRUE
holmis83
  • 15,922
  • 5
  • 82
  • 83
rolling stone
  • 543
  • 1
  • 8
  • 26
  • Use a `` and define both your Tomcat servers in there, then use the balancer address you set in the `ProxyPass` – arco444 Nov 19 '14 at 10:17
  • Could you pls elaborate.I am new to these kind of configuration. And i think it is something which is not with mod_jk – rolling stone Nov 19 '14 at 10:41
  • Yes, but neither is `ProxyPass`. It's from `mod_proxy`, not `mod_jk`. Type `ProxyBalancer` into a search engine and you'll find instructions on how to use it. – arco444 Nov 19 '14 at 10:54
  • I did this one but didnt help me. BalancerMember ajp://localhost:8009/j_spring_security_check loadfactor=1 BalancerMember ajp://localhost:8070/j_spring_security_check loadfactor=2 ProxyPass /j_spring_security_check balancer://mycluster – rolling stone Nov 19 '14 at 11:06

0 Answers0