Forum Moderators: phranque

Message Too Old, No Replies

Loadbalancing using mod jk

         

martinr

8:51 am on Jun 5, 2014 (gmt 0)

10+ Year Member



Hello Everyone,

I have to two liferay instances located on different servers which I am trying to loadbalance using mod_jk.

workers.properties in apache:

worker.list=lb_patientp_lr,jkstatus
worker.lilac9009.host=host.x.com
worker.lilac9009.port=9009
worker.lilac9009.lbfactor=1
worker.lilac9009.type=ajp13
worker.lilac9009.domain=lilac9009
worker.lilac9009.connection_pool_timeout=60
worker.lilac9009.socket_keepalive=1
worker.lilac9090.redirect=thuja9090

worker.thuja9009.host=host.y.com
worker.thuja9009.port=9009
worker.thuja9009.lbfactor=1
worker.thuja9009.type=ajp13
worker.thuja9009.domain=thuja9009
worker.thuja9009.connection_pool_timeout=60
worker.thuja9009.socket_keepalive=1

worker.lb_patientp_lr.balance_workers=lilac9009,thuja9009
worker.lb_patientp_lr.sticky_session=1
worker.lb_patientp_lr.type=lb
worker.lb_patientp_lr.method=B


Tomcat server.xml:
<Connector port="9009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8" jvmRoute="thuja9009"
maxThreads="512" connectionTimeout="600"/>

<Engine name="Catalina" defaultHost="localhost" jvmRoute="thuja9009">

<Connector port="9009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8" jvmRoute="lilac9009"
maxThreads="512" connectionTimeout="600"/>

<Engine name="Catalina" defaultHost="localhost" jvmRoute="thuja9009">


The problem is that one instance (thuja) is always preferred. When both instances are active then all requests seem to go to thuja.
When I shutdown thuja instance then other instance lilac automatically start serving requests. However if I then start thuja again, then all the request again go to that instance. Does anyone have idea, why that is so? Both instance have lbfactor=1 and I dont see why one should be favoured.

Best,
Martin