You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 17 Next »

A server identifies the run-time environment that you want to use for testing your project resources. A server configuration contains information that is required to set up and publish a server. Geronimo 2.1 provides the capability for configuring multiple server instances on a single physical server. Currently multiple instances of Geronimo share the following directories in <Geronimo_HOME>, the directory where you installed Geronimo.

  • bin
  • lib
  • schema
  • repository

Each instance gets its own copy of the following at <Geronimo_HOME>/<instance_name>:

  • var
  • deploy (hot deployment)

bin, lib, and schema are read-only, and thus might be shared between instances. The repository is shared, i.e. an application deployed in one instance will show up in the list of deployed modules, but not running, in all the other instances.

This topic is organized into the following sections:

Creating a second server instance

You can create other server instances besides the default server instance. The server instances can be created inside or outside of <Geronimo_HOME>. Take the following steps to create a new server instance, for example, instance2, under <Geronimo_HOME>:

  1. Change directory to <Geronimo_HOME>.
  2. Create a directory named instance2 under <Geronimo_HOME>.
  3. Copy the <Geronimo_HOME>/var directory to <Geronimo_HOME>/instance2.
  4. Open the config-substitutions.properties file under <Geronimo_HOME>/instance2/var/config/.
  5. Change the value of portOffset from 0 to another integer(for example 10) to avoid port conflict with the default server.

Note To have more than one server instance running simultaneously, each server instance must use a unique port. When you create server instances in addition to the default, you need to manually change the default port number for the new server instances you are creating so that they do not conflict with any of the other server instances. To change the port number for the server instance, open the config-substitutions.properties file under <Geronimo_HOME>/instancex/var/config/ and change the value of portOffset.

Starting the second server instance

Still take instance2 as an example. To start server instance2, you can follow the steps below:

  1. Start a command prompt and change directory to the <Geronimo_HOME> directory.
  2. Set the GERONIMO_OPTS environment variable by entering the following command:
    On a Windows system set GERONIMO_OPTS=-Dorg.apache.geronimo.server.name=<path_of_instance2>
    On non-Windows system export GERONIMO_OPTS=-Dorg.apache.geronimo.server.name=<path_of_instance2>
    Note that <path_of_instance2> is the relative path of instance2 from <Geronimo_HOME>.
  3. Start the server instance2 from the current command prompt using this command from the <Geronimo_HOME>/bin directory: geronimo(.bat|.sh) run.

Follow the same steps to create and start more server instances.

Stopping the second server instance

To stop server instance2, you can follow the steps below:

  1. Start a command prompt and change directory to the <Geronimo_HOME>/bin directory.
  2. execute the shutdown script with --port specified, if the portOffset is set 10 for the instance2, value of --port options should be 1109(NamingPort+PortOffset): shutdowno(.bat|.sh) --port 1109.
  • No labels