[JIRA] Commented: (OFBIZ-890) multi-tenanting ofbiz (many instances on one server)

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

[JIRA] Commented: (OFBIZ-890) multi-tenanting ofbiz (many instances on one server)

JIRA jira@ofbiz.org
     [ http://jira.undersunconsulting.com/browse/OFBIZ-890?page=comments#action_13585 ]
     
Oleg Kozyrev commented on OFBIZ-890:
------------------------------------

Hello all,

Well, in my University we have arranged the following system. There is one build of OFBiz on the server, and all clients machines have there own "ofbiz-config" dir, which contain all files from base/config, framework/service, framework/entity. In this case we can change all the config for each instance independently.

We have commented out loading of config dir in framework/service, and these are loading from "ofbiz-config" dir on a local machine (with unique IP).

Startup script for OFBiz in this case is modified:

#!/bin/sh
####
# $Id: startofbiz.sh 5952 2005-10-13 09:52:25Z jonesde $
####

# shutdown settings
ADMIN_PORT=10523
ADMIN_KEY=so3du5kasd5dn

# console log file
OFBIZ_LOG=logs/console.log

# delete the last log
rm -f $OFBIZ_LOG

# VM args
ADMIN="-Dofbiz.admin.port=$ADMIN_PORT -Dofbiz.admin.key=$ADMIN_KEY"
#DEBUG="-Dsun.rmi.server.exceptionTrace=true"
#RMIIF="-Djava.rmi.server.hostname=<set your IP address here>"
MEMIF="-Xms128M -Xmx128M"
USERPROPS="-Dofbiz.base.config=/home/${USER}/ofbiz-config/config
-Dofbiz.base.containers
-Dofbiz.container.config=/home/${USER}/ofbiz-config/config/ofbiz-containers.xml
-Dofbiz.log.dir=/home/${USER}/ofbiz-config/logs
-Dderby.system.home=/home/${USER}/ofbiz-config/data/derby"
VMARGS="$MEMIF $DEBUG $RMIIF $ADMIN $USERPROPS"


# Worldpay Config
#VMARGS="-Xbootclasspath/p:applications/accounting/lib/cryptix.jar $VMARGS"

# location of java executable
if [ -f "$JAVA_HOME/bin/java" ]; then
  JAVA=$JAVA_HOME/bin/java
else
  JAVA=java
fi

JAVA=/usr/java/j2re1.4.2_03/bin/java

# start ofbiz
cd /home/ofbiz/ofbiz
#$JAVA $VMARGS -jar ofbiz.jar $* >>$OFBIZ_LOG 2>>$OFBIZ_LOG&
$JAVA $VMARGS -jar ofbiz.jar
exit 0


So, if you want to have independent properties for each of the instances, you probably can move them to the "ofbiz-config" dir and to comment them out in the application. Afterwards you can create new applications, like party-config or marketing-config, which contains only config for party and marketing. In this way companies can use one OFBiz build, multiple instances, which are fully independent, one db server.

Well, this works fine at tmy place. I think, with some improvements it can solve the problem.


> multi-tenanting ofbiz (many instances on one server)
> ----------------------------------------------------
>
>          Key: OFBIZ-890
>          URL: http://jira.undersunconsulting.com/browse/OFBIZ-890
>      Project: [OFBiz] Open For Business
>         Type: New Feature
>   Components: webapp
>     Versions: SVN
>     Reporter: Si Chen
>     Assignee: Jira Administrator
>      Fix For: SVN

>
>
> I've been thinking about a way to run multiple instances (ie, many companies) on one server, and I think it could be done reasonably easily this way:
> 1.  In ofbiz-component.xml, in each <webapp ...>, allow many servers to be declared in the server="" attribute.  (ie: server="company1, company2, company3")
> 2.  In ofbiz-containers.xml, declare each of those servers to run on different ports.
> 3.  In entityengine.xml and serviceengine.xml, declare a different delegator and dispatcher for each instance or company.  This means each company will have its own database, though possibly all on the same database server, which I think is a good thing.
> 4.  When system starts up, it will load each webapp into every server specified in <webapp server=""> in ofbiz-component.xml
> 5.  Then, when it is loading delegator and dispatcher, it will create one based on server="" name and the name of delegator and dispatcher in web.xml.  Hence, there'd be a company1-default and company2-default.  Out of respect for current convention, we can keep it so that server="default" gets us "default" delegator and dispatcher rather than "default-default".
> 6.  When loading data with install or install-seed, add optional parameter to specify delegator name, so seed data can be loaded into various separate delegators for different companies.
> Would this cause any problems?

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.undersunconsulting.com/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira