Multiple instances on a server

Thanks Jason, This will definitely help.

···

----- Original Message -----
From: "Jason Pickering" <jason.p.pickering@gmail.com>
To: "Dapo Adejumo" <dapo_adejumo@yahoo.com>
Cc: dhis2-devs@lists.launchpad.net
Sent: Wednesday, 22 February, 2012 6:15:55 AM
Subject: Re: [Dhis2-devs] Multiple instances on a server

Hi Dapo,

I know of two ways to do this, and suspect there may be others.

A) This method will utilize a single Tomcat container, with multiple
DHIS2 instances.
0) Create two copies of the dhis.war file...dhis.war and dhis_XX,war
for instance. Unzip the war file into these directories.
1) Using the tool "mc" navigate to
/webapps/dhis_XX/WEB-INF/lib/dhis-support-external.2.X.jar where X is
the version number.
2) Open up the JAR file with mc and navigate to
META-INF/dhis/beans.xml and modify DHIS2_HOME to DHIS2_HOME_XX where
XX can be anything really.
3) You need to setup an environment variable in your system for
DHIS2_HOME_XX (i.e. /usr/local/etc/dhis2_XX/)
4) Create a hibernate properties file in DHIS2_HOME_XX.
5) Start Tomcat. You will now have two separate DHIS instance running
which are controlled by two separate environment variables
(DHIS2_HOME) and (DHIS2_HOME_XX)

The disadvantage here is that you have to modify this file each time
you upgrade DHIS.

B) Two separate Tomcat instances. This is the method I prefer.
0) Create two separate tomcat instances...for instance
/usr/local/tomcat1 and /usr/local/tomcat2
1) You will need to modify the server.xml file of one of the instances
(e.g tomcat2) to startup on a different port that /tomcat1. How you do
this depends a bit on the types of connectors you may be using
(HTTP,AJP, etc) but this is well documented elsewhere about how to
modify the ports Tomcat runs on.
2) Create a file in each /bin directory of the tomcat directories
called setenv.sh (Linux) or setenv.bat (Windows) and define the
DHIS2_HOME directory to point to two separate locations. Create two
separate hibernate.properties files.
3) You will now have two separate instance running on the ports which
you have defined in the respective server.xml files.

Hope this helps.

Best regards,
Jason

On Tue, Feb 21, 2012 at 5:23 PM, Dapo Adejumo <dapo_adejumo@yahoo.com> wrote:

Hello,
Please does anyone have any ideas on how to deploy multiple instances on a
single server in an efficient manner which doesn't drain server resources
dramatically.....Thinking of Deploying multiple instances of Tomcat VS
Multiple war files in the same Tomcat.

Thank you.

________________________________

Regards,

Adedapo Adejumo.
Mobile : +2348033683677
Skype : dapojorge

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help : https://help.launchpad.net/ListHelp