It is possible to run multiple instances of Geronimo on the same machine. Currently multiple instances of Geronimo share the following directories in <geronimo_home>
, the directory where you installed Geronimo.
- bin
- lib
- schema
- data
Each instance gets its own copy of the following at <geronimo_home>/<instance_name>
- var
- etc
- repoository
The bin, lib and schema directories are read-only, and thus are shared between instances. The repository is not shared, which means that an application deployed in one instance will only show up in the list of deployed modules of the deployed instance.
Creating a new server instance
Start with a fresh image of Geronimo. Do not use an image that has been used to run the default instance.
To create an instance named foo
do the following. All your instance data will be put in <geronimo_home>/foo
. All the directories named below are relative to <geronimo_home>
.
Follow the procedures as below:
- Create a directory
foo
under<geronimo_home>
. - Copy
var
,repository
andetc
directories tofoo
.You can use the command deploy:new-server-instance to help you with this step. - Edit
foo/var/config/config-substitutions.properties
and change the portOffset. Try using any integers such as 1, 2, 10, 20, 30.. for various instances.
The ActiveMQ doesn't consume portOffset from config-substitutions.properties yet, therefore multiple-instance won't work until GERONIMO-5559 is fixed~!
Running an instance
- Set the
org.apache.geronimo.server.name
system property to define a server name before you start the server. This system property is null by default, defining the server instance at<geronimo_home>
as the default instance. Use the syntax-Dorg.apache.geronimo.server.name=foo
to change the server name to an instance namedfoo
located at<geronimo_home>/foo
. Add this to yourGERONIMO_OPTS
environment variable:
- On a Windows system:
set GERONIMO_OPTS=-Dorg.apache.geronimo.server.name=foo
- On a Unix-like system:
export GERONIMO_OPTS=-Dorg.apache.geronimo.server.name=foo
- Start the server using startup
<geronimo_home>/bin/startup
- To shutdown this instance, use the port number of RMI Naming port (default 1099). For the new instance
foo
, the port number should be 1099 plus portOffset specified infoo/var/config/config-substitutions.properties
.<geronimo_home>/bin/shutdown --port <port_num>
- To deploy applications to this instance use the port number of RMI Naming port
<geronimo_home>/bin/deploy --port <port_num> deploy <applications>
The Administrative Console can also be used for all these operations. Connect to an instance by using the right HTTP port (default 8080).
Further readings
To use multiple repositories see Configuring multiple Repositories.