Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Regarding both Geronimo javaee6 and minimal release bundles. Full support for multiple instances was completed in GERONIMO-6270 and its sub-tasks. This support is available in the latest snapshots after March 1, 2012, and will be in the 3.0-beta-2 standard release. This documents how to run multiple instances after applying the changes from GERONIMO-6270.

For prior releases, multiple installations can safely run side-by-side by completely copying the server folder to another, and start the 2nd server installation after changing its portOffset value.

...

The layout of a Geronimo instance

...

It is possible to run multiple instances of Geronimo on the same machine.

...

  • <GERONIMO_HOME>/
    • bin
    • jsr88
    • lib
    • schema

...

  • <GERONIMO_HOME>/
    • repository (This is the primary shared repository for bootstrapping Geronimo instances)

...

...

When running multiple instances, do not run a server from GERONIMO_HOME but only from GERONIMO_SERVER roots. Also set the GERONIMO_HOME/repository to be read-only to help prevent accidentally deploying to it when instead the intention is to deploy to the local repository for each Geronimo instance at GERONIMO_SERVER/repository.

...

Each instance gets its own copy of the following at <geronimo_home>/<instance_name> . etc is read-only and var is read-write. Both are necessary for each Geronimo instance.

...

The bin, lib and schema directories are read-only, and thus are shared between instances. The repository is also shared, which means that an application deployed in one instance will show up in the list of deployed modules for all instances. Thus creating the second repository for each instance is recommended to keep deployments local to the Geronimo instances. See Configuring multiple Repositories.

Here is an example layout of what it would look like to have installed one Geronimo instance named "foo-server".

...

...

Creating a new server instance

...

  1. Create a directory foo-server under <geronimo_home>.
  2. Copy var and etc directories to foo-server. You can use the command deploy:new-server-instance to help you with this step. < GERONIMO-6287
  3. Recommended: create foo-server/repository and set it up as a second repository for the Geronimo instance. See Configuring multiple Repositories
  4. Edit foo-server/var/config/config-substitutions.properties and change the portOffset. Try using any integers such as 1, 2, 10, 20, 30.. for various instances.

...

  • On a Windows system: set GERONIMO_SERVER="foo-server"
  • On a Unix-like system: export GERONIMO_SERVER="foo-server"
  1. Start the server using startup No FormatborderStylesolid <geronimo_home>/bin/startup
  2. To shutdown this instance, use the port number of RMI Naming port (default 1099). For the new instance foo-server, the port number should be 1099 plus portOffset specified in foo-server/var/config/config-substitutions.properties. No FormatborderStylesolid <geronimo_home>/bin/shutdown --port <RMI_port_num>
  3. To deploy applications to this instance use the port number of RMI Naming port

...

  • This deploys to the primary Geronimo repository

...

  • solid

...

  • <geronimo_home>/bin/deploy

...

  • --port

...

  • <RMI_port_num>

...

  • deploy

...

  • <applications>

...

  • This deploys to a secondary Geronimo repository exclusive to the Geronimo server defined as GERONIMO_SERVER=foo-server. See Configuring multiple Repositories for more detailed instructions.

...

  • solid

...

  • <geronimo_home>/bin/deploy

...

  • --port

...

  • <RMI_port_num>

...

  • deploy

...

  • --targets

...

  • <foo_repo_name>

...

  • <applications>

...

The Administrative Console can also be used for all these operations. Connect to an instance by using the right HTTP port (default 8080).

...

  • First download the Geronimo bundle distribution
  • Determine what you want GERONIMO_HOME to be. We will use /opt/geronimo3 for this example.
  • Unpack the Geronimo bundle, and move the unpacked directory to /opt/geronimo3
  • We'll create two Geronimo instances named gserv1 and gserv2
    • Create the Geronimo instance directories as /opt/geronimo3/gserv1 and /opt/geronimo3/gserv2
    • Copy the directories var and etc to each instance directory
    • Create a repository directory within each instance directory and set it up as a second repository for the corresponding Geronimo instance. See Configuring multiple Repositories
    • Modify the gserv(1|2)/var/config/config-substitutions.properties file for each Geronimo instance changing the PortOffset. We'll set the PortOffset for gserv1 to 100 and the PortOffset for gserv2 to 200 for our example.
    • Create a start script in each Geronimo instance directory to make it easier to start each instance
      • /opt/geronimo3/gserv1/start.sh No FormatborderStylesolid #!/bin/bash # Geronimo start script # instance: gserv1 # Uncomment this to explicitly set Geronimo's runtime Java #JAVA_HOME=/usr/jdk1.6.0_25 #PATH=${JAVA_HOME}/bin:${PATH} export GERONIMO_HOME=/opt/geronimo3 export GERONIMO_SERVER=gserv1 cd ${GERONIMO_SERVER} # Normal startup ${GERONIMO_HOME}/bin/startup # Interactive startup #${GERONIMO_HOME}/bin/geronimo run
      • /opt/geronimo3/gserv2/start.sh No FormatborderStylesolid #!/bin/bash # Geronimo start script # instance: gserv2 # Uncomment this to explicitly set Geronimo's runtime Java #JAVA_HOME=/usr/jdk1.6.0_25 #PATH=${JAVA_HOME}/bin:${PATH} export GERONIMO_HOME=/opt/geronimo3 export GERONIMO_SERVER=gserv2 cd ${GERONIMO_SERVER} # Normal startuo ${GERONIMO_HOME}/bin/startup # Interactive startup #${GERONIMO_HOME}/bin/geronimo run
    • On linux, make the start script is executable with chmod: chmod 755 start.sh
  • Your Geronimo installation file structure should look something similar to this: No FormatborderStylesolid /opt/geronimo3 |-- LICENSE |-- NOTICE |-- README.txt |-- RELEASE_NOTES-3.0-SNAPSHOT.txt |-- bin |-- -etc- |-- gserv1 | |-- etc | |-- repository | |-- start.sh | `-- var |-- gserv2 | |-- etc | |-- repository | |-- start.sh | `-- var |-- jsr88 |-- lib |-- +repository+ |-- schema `-- -var- It is suggested that in GERONIMO_HOME/etc and GERONIMO_HOME/var are removed and GERONIMO_HOME/repository is made read-only
  • Finally you can start up each instance by executing their associated start script you just created in the previous step

...