You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Russell E Glaue <rg...@cait.org> on 2011/09/26 16:58:24 UTC

[Discussion] Running Multiple Geronimo Instances

Running multiple Geronimo instances
https://cwiki.apache.org/confluence/display/GMOxDOC30/Running+multiple+Geronimo+instances

Now with Rex's latest patch for ActiveMQ configuration, via GERONIMO-5987, I am
able to startup multiple instances of the Geronimo javaee6 bundle.
Follow the startup procedures from the Wiki page and GERONIMO-5987 (for a
workaround to the ActiveMQ lock file)


Can anyone tell me, if one deploys multiple instances of Geronimo javaee6
(latest snapshot only) according to the wiki page, are there are any concerns
about a successful and long term runtime operation of the multiple instances on
a single runtime OS?


-RG


Re: [Discussion] Running Multiple Geronimo Instances

Posted by Russell E Glaue <rg...@cait.org>.
Another issue found with SnapshotConfigXMLBuilder explicitly using GERONIMO_HOME
({org.apache.geronimo.home.dir}) and not the {basedir} named server instance
directory.

This time I made everything other than the named server instance directory
read-only (i.e. only GERONIMO_HOME/GERONIMO_SERVER is read-write), and received
this error message:
-
2011-09-28 11:06:24,484 ERROR [SnapshotConfigXMLBuilder] Could not make the
directory /opt/geronimo3/var/monitoring/
2011-09-28 11:06:24,485 ERROR [SnapshotConfigXMLBuilder]
/opt/geronimo3/var/monitoring/snapshot-config.xml (No such file or directory)
-

I found the corresponding source code.

Regarding the sources:
1.
trunk/plugins/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/ejb/snapshot/SnapshotProcessor.java
-
    /**
     * Checks to see if the GERONIMO_HOME/var/monitoring/ directory was made.
     * If not, the method creates it.
     */
    public static void ensureMonitorDir() {
        final String pathToDir =
            System.getProperty("org.apache.geronimo.home.dir") + "/var/monitoring/";
        File dir = new File(pathToDir);
        if(dir.exists() && dir.isDirectory()) {
            // all good
            return;
        } else {
            // make a directory
            if(dir.mkdir()) {
                // directory was successfully created
                log.info("/var/monitoring directory created.");
                return;
            } else {
                log.error("Could not make the directory " + pathToDir);
            }
        }
    }
-

2.
trunk/plugins/monitoring/agent-jar/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotConfigXMLBuilder.java
-
public class SnapshotConfigXMLBuilder {
...
    private static final String pathToXML =
        System.getProperty("org.apache.geronimo.home.dir") +
"/var/monitoring/snapshot-config.xml";
...
    /**
     * Checks to see if the GERONIMO_HOME/var/monitoring/ directory was made.
     * If not, the method creates it.
     */
    public static void ensureMonitorDir() {
        final String pathToDir =
            System.getProperty("org.apache.geronimo.home.dir") + "/var/monitoring/";
        File dir = new File(pathToDir);
        if(dir.exists() && dir.isDirectory()) {
            // all good
            return;
        } else {
            // make a directory
            if(dir.mkdir()) {
                // directory was successfully created
                log.info("/var/monitoring directory created.");
                return;
            } else {
                log.error("Could not make the directory " + pathToDir);
            }
        }
    }
-



On 09/26/2011 09:58 AM, Russell E Glaue wrote:
> Running multiple Geronimo instances
> https://cwiki.apache.org/confluence/display/GMOxDOC30/Running+multiple+Geronimo+instances
> 
> Now with Rex's latest patch for ActiveMQ configuration, via GERONIMO-5987, I am
> able to startup multiple instances of the Geronimo javaee6 bundle.
> Follow the startup procedures from the Wiki page and GERONIMO-5987 (for a
> workaround to the ActiveMQ lock file)
> 
> 
> Can anyone tell me, if one deploys multiple instances of Geronimo javaee6
> (latest snapshot only) according to the wiki page, are there are any concerns
> about a successful and long term runtime operation of the multiple instances on
> a single runtime OS?
> 
> 
> -RG
> 

Re: [Discussion] Running Multiple Geronimo Instances

Posted by Russell E Glaue <rg...@cait.org>.
The JIRA system is back up from maintenance, and I will file this.
However, I'd like to have some discussion on the mail list about these issues.

Especially considering the new addition of karaf. Has karaf been integrated so
it can be safely used between multiple instances in this manner?


I have discovered 3 issues in regards to running at least one single Geronimo
instance under a directory specified as {org.apache.geronimo.server.name}
opposed to GERONIMO_HOME (or {org.apache.geronimo.home.dir}).

I have been able to workaround the first two issues by setting properties. The
third issue is one I do not have a workaround for, as a system property is not
being picked up by Geronimo.

To produce these issues, I executed the steps documented in the wiki page
(https://cwiki.apache.org/confluence/display/GMOxDOC30/Running+multiple+Geronimo+instances),
and then removed the "etc", "repository", and "var" directories from GERONIMO_HOME.


1) GERONIMO_TMPDIR
On startup, the `bin/geronimo` startup script sets GERONIMO_TMPDIR explicitly as
$GERONIMO_HOME/var/temp , but the actual temp directory is really
{org.apache.geronimo.server.dir}/var/temp (or
$GERONIMO_HOME/{org.apache.geronimo.server.name}/var/temp)
It does not account for the cases where an instance is being started.

The workaround is to specifically specify GERONIMO_TMPDIR in your environment
before starting the instance.

Case and workaround attached as g3_mult_inst_temp_directory.txt


2) karaf.home
On startup, the `bin/geronimo` script sets karaf.home explicitly as
$GERONIMO_HOME . Karaf expects to use {karaf.home}/etc/shell.init.script each
time a shell session is started (See:
geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/text/etc/system.properties).
The setting of the karaf.home property in `bin/geronimo` does not account for
the cases where a Geronimo named instance is being started.

The workaround is to set karaf.home in GERONIMO_OPTS before starting the instance.

Case and workaround attached as g3_mult_inst_shell_init_script.txt


3) Repository Path
Geronimo expects the repository to be located as GERONIMO_HOME/repository , but
the actual repository directory is really
{org.apache.geronimo.server.dir}/repository (or
$GERONIMO_HOME/{org.apache.geronimo.server.name}/repository)
Geronimo does not account for the cases where an instance is being started with
its own repository.

There is a system property to define the root path of the repository, but unless
my understanding of this property is wrong, Geronimo does not use it.

https://cwiki.apache.org/confluence/display/GMOxDOC30/System+Properties
  OptionClass: org.apache.geronimo.repository.boot.path
  Value: undefined
  Default: undefined
  Description: Specifies the path of the server repository.

Even if setting the property org.apache.geronimo.repository.boot.path to a valid
value (like /opt/geronimo3/gserv1/repository), you still get an error:
-
java.lang.IllegalStateException: Maven2Repository must have a root that's a
valid readable directory (not /opt/geronimo3/repository)
-

Case attached as g3_mult_inst_repository_path.txt



This is what I am using for a start script to test:
-
#!/bin/bash
GHOME=/opt/geronimo3
GVIRT=gserv1

# Must change to the server directory in order to work around ActiveMQ lock
# file conflict issue reported in GERONIMO-5987.
cd ${GHOME}/${GVIRT}

GERONIMO_OPTS="${GERONIMO_OPTS} -Dorg.apache.geronimo.server.name=${GVIRT}"
GERONIMO_OPTS="${GERONIMO_OPTS} -Dkaraf.home=${GHOME}/${GVIRT}"
GERONIMO_OPTS="${GERONIMO_OPTS}
-Dorg.apache.geronimo.repository.boot.path=${GHOME}/${GVIRT}/repository"
export GERONIMO_OPTS
export GERONIMO_TMPDIR=${GHOME}/${GVIRT}/var/temp
${GHOME}/bin/geronimo run
-

-RG


On 09/26/2011 09:58 AM, Russell E Glaue wrote:
> Running multiple Geronimo instances
> https://cwiki.apache.org/confluence/display/GMOxDOC30/Running+multiple+Geronimo+instances
> 
> Now with Rex's latest patch for ActiveMQ configuration, via GERONIMO-5987, I am
> able to startup multiple instances of the Geronimo javaee6 bundle.
> Follow the startup procedures from the Wiki page and GERONIMO-5987 (for a
> workaround to the ActiveMQ lock file)
> 
> 
> Can anyone tell me, if one deploys multiple instances of Geronimo javaee6
> (latest snapshot only) according to the wiki page, are there are any concerns
> about a successful and long term runtime operation of the multiple instances on
> a single runtime OS?
> 
> 
> -RG
>