Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: updated multiple server instances directions

...

  1. Set the org.apache.geronimo.server.name system property to the instance name before you start the server.
    • Use the syntax -Dorg.apache.geronimo.server.name=foo to name your instance foo.
    • There are two ways to do this:
      1. Add this to your GERONIMO_OPTS environment variable, or
      2. Pass it on the java command-line invocation of the server.
    • The This server's var and deploy directory will then be in under <geronimo_home>/foo.
    • org.apache.geronimo.server.name may be any pathname relative to (descending from) <geronimo_home>. For example, servers/bar would put the server's var directory in under <geronimo_home>/servers/bar.
    • The org.apache.geronimo.server.dir system property may also be used, and it overrides org.apache.geronimo.server.name.
    • Use org.apache.geronimo.server.name to specify an absolute path, which need not be relative to <geronimo_home>. For example, /ag20/servers/bar would put the server's var directory at under /ag20/servers/bar. Otherwise, the two system properties behave the same.
  2. mkdir foo
  3. Copy var/* to foo./var/
  4. Edit foo/var/config.xml and change all the port attributes so they don't conflict with servers you have already /config-substitutions.properties, uncomment portOffset and change it to a value like 10, so the ports in the new server instance will not conflict with existing server instances you already have defined and/or started. Look for <attribute name="port"> in the file.Start the server.
  5. Start the server.

To deploy applications to the new server instance, you need to specify the PlanNamingPort+portOffset used, such as:

  • deploy -port 1109 list-modules

Multiple Repositories

First, we consider the case single server instance case, and just add a second repository. Say we want to leave Geronimo in its repository, but add a second repository to deploy our applications. Adding a second repository is pretty easy.

  1. Create a plan (say repo2.xml) for your repository module.
    Code Block
    xml
    xml
    borderStylesolid
    titlerepo2.xml
    <module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
     <environment>
      <moduleId>
       <groupId>org.example.configs</groupId>
        <artifactId>myrepo</artifactId>
        <version>2.0-SNAPSHOT</version>
        <type>car</type>
      </moduleId>
     <dependencies>
      <dependency>
       <groupId>org.apache.geronimo.configs</groupId>
       <artifactId>j2ee-system</artifactId>
       <version>2.0-SNAPSHOT</version>
       <type>car</type>
    </dependency>
     </dependencies>
     <hidden-classes/>
     <non-overridable-classes/>
    </environment>
     <\!--Repository-->
     <gbean name="Repo2" class="org.apache.geronimo.system.repository.Maven2Repository">
       <attribute name="root">repo2/</attribute>
       <reference name="ServerInfo">
        <name>ServerInfo</name>
       </reference>
     </gbean>
    
      <\!--Configuration Store service-->
      <gbean name="Local2" class="org.apache.geronimo.system.configuration.RepositoryConfigurationStore">
        <reference name="Repository">
         <name>Repo2</name>
        </reference>
      </gbean>
    </module>
    
  2. Create the repository's root directory. mkdir <geronimo_home>/repo2#* The directory is specified by the root attribute of the Maven2Repository GBean, repo2/ in the above example. It is a path relative to the base directory <geronimo_home>.
    • A resolveToServer attribute is being added to allow this path to be relative to baseServer, which is useful with multiple server instances.
  3. Deploy the repository module by deploying repo2.xml.

...

Using the new repository is a little tricky, and is only supported from the command line currently.The essence is to use the --targets option of the deploy command to target your module to deploy in your new repository. First, use the deployer list-targets command to see the repositories. The target names are long and cumbersome:

java deployer.jar list-targets

Available Targets:
org.example.configs/myrepo/2.0-SNAPSHOT/car?ServiceModule=org.example.configs/myrepo/2.0-SNAPSHOT/car,j2eeType=ConfigurationStore,name=Local2
org.apache.geronimo.configs/j2ee-system/2.0-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/j2ee-system/2.0-SNAPSHOT/car,j2eeType=ConfigurationStore,name=Local

Tip

The use of environment variables is recommended for command-line use. For example, set REPO2= org.example.configs/myrepo/2.0-SNAPSHOT/car?ServiceModule=org.example.configs/myrepo/2.0-SNAPSHOT/car,j2eeType=ConfigurationStore,name=Local2.

To deploy to the new repository, use: deploy --targets %REPO2% sample.war

deploy list-modules also gives those long target names on each module. However, deploy list-modules %REPO2% gives the accustomed short output.

The syntax to undeploy from a repo is: java deployer.jar undeploy "%REPO2%|geronimo/jsp-examples/1.1.1/war".

Note

Note the | character separates the repository name from the module name. The " quotes are used around the entire parameter to escape this special character from command shell interpretation.

...