← Back to team overview

dhis2-devs team mailing list archive

Re: Multiple DHIS2 instances on Windows

 

On 18 August 2011 13:20, Ime Asangansi <asangansi@xxxxxxxxx> wrote:
> Thanks for these answers.
>
> Please, is there a way one can put the hibernate.properties in the war file
> itself?
> This used to workout in 2.0 by just putting into WEB-INF/classes but now it
> just doesn't work
>
> I'm in a PaaS offering where I don't get access to the OS but just tomcat
> deploy. So, I'm unable to set the env variables.

Probably the best place to implement something would be as a context
parameter (http://tomcat.apache.org/tomcat-6.0-doc/config/context.html#Context_Parameters).

We could then fairly simply add yet another prioritized source of DHIS_HOME:
(i) check for context parameter called DHIS2_HOME; failing which
(ii) check for system property called dhis2.home; failing which
(III) check for env variable DHIS2_HOME.
(the final fallback on linux is to use /opt/dhis2)

The context should be configurable by the Paas provider.  Any
thoughts?  Should be a quick blueprint + some few lines of code +
testing.

Cheers
Bob

>
> Thanks
>
> Ime
>
> ________________________________
> From: Knut Staring <knutst@xxxxxxxxx>
> To: Bob Jolliffe <bobjolliffe@xxxxxxxxx>
> Cc: dhis2-devs <dhis2-devs@xxxxxxxxxxxxxxxxxxx>
> Sent: Thursday, August 18, 2011 7:47 AM
> Subject: Re: [Dhis2-devs] Multiple DHIS2 instances on Windows
>
> Thanks guys, running multiple instances of DHIS2 Live is definitely the
> easiest to set up and teach. In fact, I think there may be quite few
> instances where Tomcat is needed on Windows. And I don't even think I need
> to worry about dhis2.home - since everything is confined to the folder where
> dhis2-live.exe resides.
> As Ola pointed out, the remaining and important issue is the automated
> startup after a power cut. Found some info here, grateful for further ideas.
> http://vlaurie.com/computers2/Articles/startup.htm
> Knut
> On Thu, Aug 18, 2011 at 12:12 PM, Bob Jolliffe <bobjolliffe@xxxxxxxxx>
> wrote:
>
> On 18 August 2011 10:29, Jason Pickering <jason.p.pickering@xxxxxxxxx>
> wrote:
>> In Nigeria, we have two completely separate instance of Tomcat with
>> two environment variables
>>
>> DHIS2_HOME="/var/lib/tomcat6/conf/dhis2_conf"
>>
>> DHIS2_HOME_NG="/var/lib/tomcat6/conf/dhis2_conf_ng"
>>
>> The reason for the separate instances was really just to be able to
>> allocate
>> more CPU resources to a single Tomcat instance.
>>
>> You them modify /WEB-INF/lib/dhis-support-external-2.1-SNAPSHOT.jar
>>
>> Open up "mc" (or some other tool which can manipulate inside of a jar
>> file)
>> and navigate within the JAR file to META-INF/dhis/beans.xml
>>
>> and modify DHIS2_HOME to DHIS2_HOME_NG and then exit mc. This instance
>> will
>> read from the DHIS2_HOME_NG environment.
>>
>>  On Windows, two separate DHIS2 Live directories configured for different
>> ports would seem to be a better solution. Then you do not need to worry
>> about this hack.
>
> That's right.  dhis live doesn't use the environment variable -
> adopting instead the approach of "wherever I lay my hat, that's my
> home" :-)
>
> But it does this by using (and automatically configuring) a system
> property which takes precedence over the environment variable.  That
> system property is called dhis2.home.
>
> You should be able to set this in a variety of ways in your automatic
> startup scripts eg. by adding "-Ddhis2.home=c:/mydhis" to
> CATALINA_OPTS in tomcat startup script.  It's an alternative approach
> which might suit you.
>
> Bob
>
>>
>> Regards,
>>
>> Jason
>>
>> On Thu, Aug 18, 2011 at 11:18 AM, Knut Staring <knutst@xxxxxxxxx> wrote:
>>>
>>> Hello all,
>>> It has been a while since I last ran multiple DHIS2 instances (each with
>>> its own database) on the same Windows server. Not sure if we have reached
>>> a
>>> consensus as to best practice on this (I actually think the best practice
>>> would be to run a Ubuntu server, but in many cases people find a change
>>> of
>>> OS an additional burden when there is so much knowledge to absorb about
>>> DHIS2 itself)
>>> I see the following options:
>>> 1) Multiple war files in the same Tomcat or multiple Tomcats on different
>>> ports. If so, just download the Tomcat zip file, not installer, and
>>> configure for different ports.
>>> 2) Each dhis.war needs a separate hibernate.properties. Is this best done
>>> inside the (exploded) war file, or is it best to create multiple
>>> environment
>>> variables?
>>> How to set the JAVA_OPTS? The server has only 3GB RAM...
>>> If this has already been documented, I would be grateful for just a
>>> pointer.
>>> Thanks,
>>> Knut
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> 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
>
>
>
> --
> Cheers,
> Knut Staring
>
> _______________________________________________
> 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