• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Apache , Tomcat , Memcached

 
Roberto Gomez
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello.

I have a system with an Apache server, 2 Tomcat nodes and 2 Memcached nodes.

Apache httpd.conf:

LoadModule jk_module modules/mod_jk.so
JkWorkersFile "conf/workers.properties"
JkLogFile "logs/mod_jk.log"
JkLogLevel error
JKMount /demo/* loadbalancer


Apache workers.properties:

worker.list=loadbalancer,status
worker.samples1.port=8011
worker.samples1.host=localhost
worker.samples1.type=ajp13
worker.samples1.lbfactor=1

worker.samples2.port=8012
worker.samples2.host=localhost
worker.samples2.type=ajp13
worker.samples2.lbfactor=1

worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=samples1,samples2
wcorker.loadbalancer.sticky_session=1


Tomcat nodes context.xml:

<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
memcachedNodes="n1:127.0.0.1:11211,n2:127.0.0.1:11311"
requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
sessionBackupTimeout="30"
operationTimeout="30"
transcoderFactoryClass="de.javakaffee.web.msm.serializer.javolution.JavolutionTranscoderFactory"
/>


My problem is when I access the test page, apache sends my request to a different Tomcat node at a time, but with the same saved session in Memcached.
I want all requests from the same session are sent to the same Tomcat node.

Thanks!
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android C++ Java Linux PHP Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Check if the properties file has it as "wcorker" - it should be "worker".
 
Roberto Gomez
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Karthik.

Now I have other question.
I am testing the jk status manager and I don’t change a property of a node without restart the server. For example, I change the lb Factor and the jk status manager shows the change but does not work.
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android C++ Java Linux PHP Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure I understood the problem.
What does not work? Do you mean that you changed lbfactors via status manager UI but the requests are not being sent in proportion to the lbfactor? How did you perform this test?
Changes made via status manager UI won't be saved to the properties file; they're lost when apache httpd is shut down.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic