OFBiz clustering-session replication

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

OFBiz clustering-session replication

Neha Mehta
Hi,

I am clustering OFBiz using Apache Http Server.I have load balanced two
nodes currently.Everything is working fine for sticky session state of
tomcat.
My requirement is to cluster OFBiz using session replication.
For this i have uncommented the following code in ofbiz-containers.xml

  <!--   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>

In mcast-bind-addr i have given the IP address of OFBiz host machine.
Also in <container name="catalina-container" tag , i have given jvm-route
property,same name as in my workers.properties file.
:jvm-route<property name="jvm-route" value="tomcat2"/>

But i am not able to get session replication running on my load balanced
cluster.

I also get the following message in OFBiz logs:
This operation will timeout if no session state has been received within
60 sec.

I am not able to understand what is missing in my settings.Kindly help me
out.

Thanks & Regards,
Neha Mehta


______________________________________________________________________
Reply | Threaded
Open this post in threaded view
|

Re: OFBiz clustering-session replication

c.schinzer
Hi Neha,


the stuff that you reference doing on Apache is not a cluster in the strict
definition. It is load-balancing with some sticky info.

Typically, J2EE clusters will do the load-balancing internally and I guess
this is what is also causing your problems.

Among the basics about clusters and namely J2EE clusters, each node will
need to:

   - participate in session replication: Tomcat chooses to configure a
   ReplicationListener and a ReplicationSender
   - subscribe (and participate) in a cluster heartbeat communication,
   typically on multicast communication, hence there are the  m-cast properties

The cluster will typically manage a generic cluster IP address where
requests will be sent from outside and from there, the cluster will do it's
internal load balancing such that you do not have to bother with details of
load balancing on the Apache layer (lb-algorithm, recognizing nodes that are
ready for traffic etc.).

Having said this, each ofbiz instance will require it's own configuration
for a part of the below settings (while I am still puzzling through the
Tomcat documentation and worked examples in the net in order to understand
which ones they would be ...

Using Tomcat (as OFBiz does), the respective configuration is also
documented here:

http://tomcat.apache.org/tomcat-6.0-doc/config/cluster.html

... and for a worked example (though overly complex since the tomcats in
that example even run on the same port (but not unusual; we do that on our
production environments very frequently, but for JBoss and WLS, that's why I
do not have the Tomcat way to do things ready here)
http://docs.zkoss.org/wiki/How_to_Run_ZK_on_Apache_%2B_Tomcat_clustering,_Part_I
http://docs.zkoss.org/wiki/How_to_Run_ZK_on_Apache_%2B_Tomcat_clustering,_Part_II

Hope this helps some ...

Regards


Carsten

2009/10/5 <[hidden email]>

> Hi,
>
> I am clustering OFBiz using Apache Http Server.I have load balanced two
> nodes currently.Everything is working fine for sticky session state of
> tomcat.
> My requirement is to cluster OFBiz using session replication.
> For this i have uncommented the following code in ofbiz-containers.xml
>
>  <!--   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>
>
> In mcast-bind-addr i have given the IP address of OFBiz host machine.
> Also in <container name="catalina-container" tag , i have given jvm-route
> property,same name as in my workers.properties file.
> :jvm-route<property name="jvm-route" value="tomcat2"/>
>
> But i am not able to get session replication running on my load balanced
> cluster.
>
> I also get the following message in OFBiz logs:
> This operation will timeout if no session state has been received within
> 60 sec.
>
> I am not able to understand what is missing in my settings.Kindly help me
> out.
>
> Thanks & Regards,
> Neha Mehta
>
>
> ______________________________________________________________________




--

Best

Carsten Schinzer

Waisenhausstr. 53a
80637 München
Germany
Reply | Threaded
Open this post in threaded view
|

Re: OFBiz clustering-session replication

Neha Mehta
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


______________________________________________________________________