Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Note
titleThis is Work In Progress

This document is still being worked upon. Contributions: Welcome!

There are many ways to run a tiered application such that is is scalable (where "scalable" means that it can be set up to run more parallel sessions for users, digest more service calls etc...).

 Scalability in tiered applications means, e.g.

  • a single web server directing traffic to multiple application servers
  • many servers talking to a single database
  • servers talking to many databases
  • etc.

 
The need for scalability is not only driven by sheer capacity demand (mostly going along with requests to use low cost hardware to run services). It is very much linked to other non-functional requirements such as (high-) availability and maintainability.

This is the reason why understanding the various architecture patterns which are supported by a given application stack is crucial to deliver the right solution for a given business demand aka. requirement. This HOWTO guide talks about various options to "lay out" the physical server landscape in order to achieve certain non-functional requirements.

Most of the examples are taken from various threads on the community mailing list and replicated here in an abstract way.

Single instance of OFBiz running with public IP

Wiki Markup
\[standard case, describe pros cons here\]

Apache "in front of" OFBiz single instance (no load balancing)

Setup

Wiki Markup
\[describe pros and cons\]

...

Load balance across multiple instances of OFBiz

The below is taken from mails by Brett Palmer on user@ofbiz.apache.org

...

<container name="catalina-container"
class="org.ofbiz.catalina.container.CatalinaContainer">
<!- - static configuration for tomcat - ->
<property name="delegator-name" value="default"/>
<property name="use-naming" value="false"/>
<property name="debug" value="0"/>
<property name="catalina-runtime-home" value="runtime/catalina"/>
<property name="apps-context-reloadable" value="false"/>
<property name="apps-cross-context" value="false"/>
<property name="apps-distributable" value="false"/>
<!-- one or more tomcat engines (servers); map to this + host - ->
<property name="default-server" value="engine">
<property name="default-host" value="0.0.0.0"/>
*<property name="jvm-route" value="jvm1"/>*
<property name="access-log-pattern">
.....
=== /mail 1 ===

...

For maximum scalability you would put 1 instance of ofbiz on a single
machine and load balance between these machines.  We are using Amazon's EC2
servers so it is easy for us to shutdown to a single server at night and
then start up several server during the days when the application is busy.

=== /mail2 ===

 Multiple OFBiz instances talking to the same database



Clustering several OFBiz  instances

Clustering is a feature since Tomcat 5.5 and since OFBiz uses even Tomcat 6.0, the on board clustering with catalina has improved even more.

The configuration for clustering is comprised (and by default commented out) with
OFBIZ_HOME/framework/base/config/ofbiz-containers.xml

The following post was found  on the user mailing list on 11 NOV 2009:

Subject: "Clustering, Session Replication, Failover and Load-Balancing HOWTO"

Author: Vignesh Sabapathi

"(...) Following are the steps to be done

step 1 : create a template (as same as for ofbiz9.0 deployment in tomcat)
step 2 : Deploy ofbiz in tomcat (i tried with tomcat 6.0.16)
step 3 : Cluster tomcat instances (i used 2 tomcat instances)
step 4:  Enable session replication by changing the configurations in
server.xml file in all the nodes (use backup manager to retain cart items
during session replication)
step 5 : Enable Apache with mod_jk support
step 6 : configure Apache (create worker.properties and change the
configurations of httpd.conf and ssl.conf) to load balance tomcat servers
Step 7 : check all the functions are working with lamba probe tool" (see https://issues.apache.org/jira/browse/OFBIZ-1397)

 

Multiple OFBiz instances on the same physical machine

The port configuration of each OFBiz instance is controlled in

OFBIZ_HOME/framework/base/config/ofbiz-containers.xml