← Back to team overview

dhis2-devs team mailing list archive

Re: Multiple instances on a server

 

I would go with Jason's suggestion. But since he mentioned what I came up
with many years ago, here's a link:
http://www.openhealthconsortium.org/wiki/doku.php?id=ohm_on_an_ubuntu_server#change_the_name_of_the_dhis2_home_environment_variable


Sent from my mobile
On Feb 22, 2012 5:51 PM, "Jason Pickering" <jason.p.pickering@xxxxxxxxx>
wrote:

> Knut told me about another way of unzipping the jar file, altering the
> beans.xml file, and then zipping it up again, but this was too complex
> for me. The good ole midnight commander is a nice utility knife.
>
> I am not sure about the costs really, but the second approach is
> better for a number of reasons I think. It allows more control over
> each container, so that one might need more memory or different
> settings or what not. Also, from a load balancing perspective, if one
> container fails, it will not necessarily bring down both. I also think
> there may be advantages related to CPU utilization (at the cost of
> memory) when having the containers separate. However,it does of course
> require the management of two separate instances, which may lead to
> higher admin costs.
>
>
>
> On Wed, Feb 22, 2012 at 12:21 PM, Bob Jolliffe <bobjolliffe@xxxxxxxxx>
> wrote:
> > Nice subtle recommendation for the midnite commander :-)
> >
> > BTW I am also in favour of the latter of the two approaches.   But I
> > am curious has anyone actually measured what the relative cost of
> > running two tomcats vs one tomcat+2 webapps is?  I kind of feel
> > instinctively that it doesn't cost much, but if anyone has a measure
> > I'd be interested to hear.
> >
> > On 22 February 2012 05:15, Jason Pickering <jason.p.pickering@xxxxxxxxx>
> wrote:
> >> 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@xxxxxxxxx>
> 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@xxxxxxxxxxxxxxxxxxx
> >>> Unsubscribe : https://launchpad.net/~dhis2-devs
> >>> More help   : https://help.launchpad.net/ListHelp
> >>>
> >>
> >> _______________________________________________
> >> Mailing list: https://launchpad.net/~dhis2-devs
> >> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> >> Unsubscribe : https://launchpad.net/~dhis2-devs
> >> More help   : https://help.launchpad.net/ListHelp
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>

References