Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Skip this sub-section if you do not care about the technical internals of Geronimo's use of GERONIMO_HOME versus GERONIMO_SERVER

Inside Geronimo there is a concept of home, base, and server, with corresponding java properties org.apache.geronimo.home.dir and org.apache.geronimo.server.dir. base and server are the same, but Geronimo references base in general to reference the location for run-time configuration. The definition of server is user provided, and redefines base.

...

Running an instance

  1. Set the GERONIMO_HOME environment SERVER environment variable to define the server instance directory before you start the server. This variable will be set to GERONIMO_HOME as default if not defined. Set GERONIMO_SERVER=foo-server to change the server name to an instance named foo-server located at <GERONIMO_HOME>/foo-server, or GERONIMO_SERVER=/opt/geronimo/foo-server to set the absolute path.

...

  • 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 Format
        borderStylesolid
        #!/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 Format
        borderStylesolid
        #!/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 Format
    borderStylesolid
    /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 var are removed and 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

...