Hi,
I have successfully performed load balancing in OFBiz using Apache Http
server.I have two OFBiz servers, server1 and server2 running on two
different machines in load balancing mode with session replication.
My ofbiz-containers.xml looks like:
<property name="default-server" value="engine">
<property name="default-host" value="0.0.0.0"/>
<property name="jvm-route" value="server1"/>
<property name="access-log-pattern">
<property-value>%h %l %u %t "%r" %s %b "%{Referer}i"
"%{User-Agent}i"</property-value>
</property>
<property name="access-log-resolve" value="true"/>
<property name="access-log-rotate" value="true"/>
<property name="access-log-prefix" value="access_log."/>
<property name="access-log-dir" value="runtime/logs"/>
<property name="enable-request-dump" value="false"/>
<!-- uncomment for cluster support-->
<property name="default-server-cluster" value="cluster">
<property name="rep-valve-filter">
<property-value>
.*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;</property-value>
</property>
<property name="manager-class" value=
"org.apache.catalina.ha.session.DeltaManager"/>
<property name="debug" value="5"/>
<property name="replication-mode" value=
"org.apache.catalina.tribes.transport.bio.PooledMultiSender"/>
<property name="tcp-listen-host" value="auto"/>
<property name="tcp-listen-port" value="4001"/>
<property name="tcp-sector-timeout" value="100"/>
<property name="tcp-thread-count" value="6"/>
<property name="mcast-bind-addr" value="172.17.88.52"/>
<property name="mcast-addr" value="228.0.0.4"/>
<property name="mcast-port" value="45564"/>
<property name="mcast-freq" value="500"/>
<property name="mcast-drop-time" value="3000"/>
</property>
My workers.properties is:
worker.list=server1, server2, loadbalancer
worker.server1.port=8009
worker.server1.host=172.17.88.46
worker.server1.type=ajp13
worker.server1.lbfactor=100
worker.server1.redirect=server2
worker.server2.port=8010
worker.server2.host=172.17.88.52
worker.server2.type=ajp13
worker.server2.lbfactor=100
worker.server2.redirect=server1
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=server1, server2
I have added settings to cover node fail over i.e. if server1 fails,
server2 will continue the client's session, without asking client to
relogin into the application.
Everything works fine but when I add items into the cart using ordermgr ->
order entry or ecommerce application , and shut down server1 , the server2
continues the client's session(session is shared with server2 using
cookies), but the cart retains only the promotional items, and if there is
no promotional item, cart comes out to be empty.
Could you please tell me, how the cart is stored inside the application?
Is it inside the user's session or in request attribute?
Is there any other reason for the same...?
Kindly help me out.
Thanks & Regards,
Neha Mehta
______________________________________________________________________