geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Geronimo v3.0 > Running multiple Geronimo instances
Date Fri, 23 Sep 2011 14:24:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/4/_/styles/combined.css?spaceKey=GMOxDOC30&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Running+multiple+Geronimo+instances">Running
multiple Geronimo instances</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~rglaue">Russell
E Glaue</a>
    </h4>
        <br/>
                         <h4>Changes (9)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >{excerpt}It is possible to run
multiple instances of Geronimo on the same machine.{excerpt} Currently multiple instances
of Geronimo share the following directories in {{&lt;geronimo_home&gt;}}, the directory
where you installed Geronimo. <span class="diff-added-words"style="background-color: #dfd;">These
are read-only.</span> <br></td></tr>
            <tr><td class="diff-unchanged" >* bin <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">*
jsr88 <br></td></tr>
            <tr><td class="diff-unchanged" >* lib <br>* schema <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">*
data <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" >Each instance gets its own copy
of the following at {{&lt;geronimo_home&gt;/&lt;instance_name&gt;}} <span
class="diff-added-words"style="background-color: #dfd;">. These are read-write and are
necessary for each Geronimo instance.</span> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">*
var <br></td></tr>
            <tr><td class="diff-unchanged" >* etc <br></td></tr>
            <tr><td class="diff-changed-lines" >* <span class="diff-changed-words">repo<span
class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">o</span>sitory</span>
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">*
var <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">These
are also read-write but are not part of the minimally necessary directories and files for
running a Geronimo instance, but may be desired. The deploy directory will be automatically
created when you start Geronimo if it does not already exist. <br>* deploy <br>*
hotbundles <br> <br></td></tr>
            <tr><td class="diff-unchanged" >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. <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >The Administrative Console can also
be used for all these operations. Connect to an instance by using the right HTTP port (default
8080). <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h2.
Example runtime for multiple instances <br>* First download the Geronimo bundle distribution
<br>* Determine what you want GERONIMO_HOME to be. We will use &quot;/opt/geronimo3&quot;
for this example. <br>* Unpack the Geronimo bundle, and move the unpacked directory
to &quot;/opt/geronimo3&quot; <br>* We&#39;ll create two Geronimo instances
named gserv1 and gserv2 <br>** Create the Geronimo instance directories as &quot;/opt/geronimo3/gserv1&quot;
and &quot;/opt/geronimo3/gserv2&quot; <br>** Copy the directories &quot;var&quot;,
&quot;etc&quot;, and &quot;repository&quot; to each instance directory <br>**
Modify the &quot;var/config-substitutions&quot; file for each Geronimo instance changing
the PortOffset. We&#39;ll set the PortOffset for gserv1 to 100 and the PortOffset for
gserv2 to 200 for our example. <br>** Create a start script in each Geronimo instance
directory to make it easier to start each instance <br>*** /opt/geronimo3/gserv1/start.sh
<br>{noformat:borderStyle=solid} <br>#!/bin/bash <br># Geronimo start script
<br># instance: gserv1 <br> <br># Uncomment this to explicitly set Geronimo&#39;s
runtime Java <br>#JAVA_HOME=/usr/jdk1.6.0_25 <br>#PATH=${JAVA_HOME}/bin:${PATH}
<br> <br>GHOME=/opt/geronimo3 <br>GVIRT=gserv1 <br> <br>export
GERONIMO_OPTS=-Dorg.apache.geronimo.server.name=${GVIRT} <br># Normal startuo <br>${GHOME}/bin/startup
<br># Interactive startup <br>#${GHOME}/bin/geronimo run <br>{noformat}
<br>*** /opt/geronimo3/gserv2/start.sh <br>{noformat:borderStyle=solid} <br>#!/bin/bash
<br># Geronimo start script <br># instance: gserv2 <br> <br># Uncomment
this to explicitly set Geronimo&#39;s runtime Java <br>#JAVA_HOME=/usr/jdk1.6.0_25
<br>#PATH=${JAVA_HOME}/bin:${PATH} <br> <br>GHOME=/opt/geronimo3 <br>GVIRT=gserv2
<br> <br>export GERONIMO_OPTS=-Dorg.apache.geronimo.server.name=${GVIRT} <br>#
Normal startuo <br>${GHOME}/bin/startup <br># Interactive startup <br>#${GHOME}/bin/geronimo
run <br>{noformat} <br>** On linux, make the start script is executable with chmod:
chmod 755 start.sh <br>* Finally you can start up each instance by executing their associated
start script you just created in the previous step <br>* Your Geronimo installation
file structure should look something similar to this: <br>{noformat:borderStyle=solid}
<br>/opt/geronimo3 <br>|-- LICENSE <br>|-- NOTICE <br>|-- README.txt
<br>|-- RELEASE_NOTES-3.0-SNAPSHOT.txt <br>|-- bin <br>|-- deploy <br>|--
etc <br>|-- gserv1 <br>|   |-- etc <br>|   |-- repository <br>|  
|-- start.sh <br>|   `-- var <br>|-- gserv2 <br>|   |-- etc <br>|
  |-- repository <br>|   |-- start.sh <br>|   `-- var <br>|-- hotbundles
<br>|-- jsr88 <br>|-- lib <br>|-- repository <br>|-- schema <br>`--
var <br>{noformat} <br> <br> <br></td></tr>
            <tr><td class="diff-unchanged" >h1. Further readings <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <style type='text/css'>/*<![CDATA[*/
table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color:
#f0f0f0}
table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}

/*]]>*/</style><div class="Scrollbar"><table class='ScrollbarTable'><tr><td
class='ScrollbarPrevIcon'><a href="/confluence/display/GMOxDOC30/Running+Geronimo+as+a+service"><img
border='0' align='middle' src='/confluence/images/icons/back_16.gif' width='16' height='16'></a></td><td
width='33%' class='ScrollbarPrevName'><a href="/confluence/display/GMOxDOC30/Running+Geronimo+as+a+service">Running
Geronimo as a service</a>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a
href="/confluence/display/GMOxDOC30/Running+Geronimo"><img border='0' align='middle'
src='/confluence/images/icons/up_16.gif' width='8' height='8'></a></sup><a
href="/confluence/display/GMOxDOC30/Running+Geronimo">Running Geronimo</a></td><td
width='33%' class='ScrollbarNextName'>&nbsp;</td></tr></table></div>


<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/warning.gif" width="16" height="16"
align="absmiddle" alt="" border="0"></td><td>For the Geronimo javaee6 release
bundles, you can only run multiple instance by completely copying the server folder to another,
and start a 2nd instance after changing its portOffset value. 

<p>The feature described on this page was not fully supported yet, using <a href="https://issues.apache.org/jira/browse/GERONIMO-5987"
class="external-link" rel="nofollow">GERONIMO-5987</a> to track the status.</p></td></tr></table></div>


<p>It is possible to run multiple instances of Geronimo on the same machine. Currently
multiple instances of Geronimo share the following directories in <tt>&lt;geronimo_home&gt;</tt>,
the directory where you installed Geronimo. These are read-only.</p>
<ul>
	<li>bin</li>
	<li>jsr88</li>
	<li>lib</li>
	<li>schema</li>
</ul>


<p>Each instance gets its own copy of the following at <tt>&lt;geronimo_home&gt;/&lt;instance_name&gt;</tt>
. These are read-write and are necessary for each Geronimo instance.</p>
<ul>
	<li>etc</li>
	<li>repository</li>
	<li>var</li>
</ul>


<p>These are also read-write but are not part of the minimally necessary directories
and files for running a Geronimo instance, but may be desired. The deploy directory will be
automatically created when you start Geronimo if it does not already exist.</p>
<ul>
	<li>deploy</li>
	<li>hotbundles</li>
</ul>


<p>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.</p>

<h1><a name="RunningmultipleGeronimoinstances-Creatinganewserverinstance"></a>Creating
a new server instance</h1>

<p>Start with a fresh image of Geronimo. Do not use an image that has been used to run
the default instance.</p>

<p>To create an instance named <tt>foo</tt> do the following. All your instance
data will be put in <tt>&lt;geronimo_home&gt;/foo</tt>. All the directories
named below are relative to <tt>&lt;geronimo_home&gt;</tt>.<br/>
Follow the procedures as below:</p>
<ol>
	<li>Create a directory <tt>foo</tt> under <tt>&lt;geronimo_home&gt;</tt>.</li>
	<li>Copy <tt>var</tt>, <tt>repository</tt> and <tt>etc</tt>
directories to <tt>foo</tt>.You can use the command <a href="/confluence/display/GMOxDOC30/gogo+commands+for+Geronimo#gogocommandsforGeronimo-gogocommandsforGeronimogogocommandnewserverins...">deploy:new-server-instance</a>
to help you with this step.</li>
	<li>Edit <tt>foo/var/config/config-substitutions.properties</tt> and change
the portOffset. Try using any integers such as 1, 2, 10, 20, 30.. for various instances.</li>
</ol>



<h1><a name="RunningmultipleGeronimoinstances-Runninganinstance"></a>Running
an instance</h1>

<ol>
	<li>Set the <tt>org.apache.geronimo.server.name</tt> system property to
define a server name before you start the server. This system property is null by default,
defining the server instance at <tt>&lt;geronimo_home&gt;</tt> as the
default instance. Use the syntax <tt>&#45;Dorg.apache.geronimo.server.name=foo</tt>
to change the server name to an instance named <tt>foo</tt> located at <tt>&lt;geronimo_home&gt;/foo</tt>.
Add this to your <tt>GERONIMO_OPTS</tt> environment variable:</li>
</ol>
<ul>
	<li>On a Windows system: <tt>set GERONIMO_OPTS=-Dorg.apache.geronimo.server.name=foo</tt></li>
	<li>On a Unix-like system: <tt>export GERONIMO_OPTS=-Dorg.apache.geronimo.server.name=foo</tt></li>
</ul>
<ol>
	<li>Start the server using startup
<div class="preformatted panel" style="border-style: solid;border-width: 1px;"><div
class="preformattedContent panelContent">
<pre>&lt;geronimo_home&gt;/bin/startup
</pre>
</div></div></li>
	<li>To shutdown this instance, use the port number of RMI Naming port (default 1099).
For the new instance <tt>foo</tt>, the port number should be 1099 plus portOffset
specified in <tt>foo/var/config/config-substitutions.properties</tt>.
<div class="preformatted panel" style="border-style: solid;border-width: 1px;"><div
class="preformattedContent panelContent">
<pre>&lt;geronimo_home&gt;/bin/shutdown --port &lt;port_num&gt;
</pre>
</div></div></li>
	<li>To deploy applications to this instance use the port number of RMI Naming port
<div class="preformatted panel" style="border-style: solid;border-width: 1px;"><div
class="preformattedContent panelContent">
<pre>&lt;geronimo_home&gt;/bin/deploy --port &lt;port_num&gt; deploy
&lt;applications&gt;
</pre>
</div></div></li>
</ol>


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

<h2><a name="RunningmultipleGeronimoinstances-Exampleruntimeformultipleinstances"></a>Example
runtime for multiple instances</h2>
<ul>
	<li>First download the Geronimo bundle distribution</li>
	<li>Determine what you want GERONIMO_HOME to be. We will use "/opt/geronimo3" for this
example.</li>
	<li>Unpack the Geronimo bundle, and move the unpacked directory to "/opt/geronimo3"</li>
	<li>We'll create two Geronimo instances named gserv1 and gserv2
	<ul>
		<li>Create the Geronimo instance directories as "/opt/geronimo3/gserv1" and "/opt/geronimo3/gserv2"</li>
		<li>Copy the directories "var", "etc", and "repository" to each instance directory</li>
		<li>Modify the "var/config-substitutions" 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.</li>
		<li>Create a start script in each Geronimo instance directory to make it easier to
start each instance
		<ul>
			<li>/opt/geronimo3/gserv1/start.sh
<div class="preformatted panel" style="border-style: solid;border-width: 1px;"><div
class="preformattedContent panelContent">
<pre>#!/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}

GHOME=/opt/geronimo3
GVIRT=gserv1

export GERONIMO_OPTS=-Dorg.apache.geronimo.server.name=${GVIRT}
# Normal startuo
${GHOME}/bin/startup
# Interactive startup
#${GHOME}/bin/geronimo run
</pre>
</div></div></li>
			<li>/opt/geronimo3/gserv2/start.sh
<div class="preformatted panel" style="border-style: solid;border-width: 1px;"><div
class="preformattedContent panelContent">
<pre>#!/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}

GHOME=/opt/geronimo3
GVIRT=gserv2

export GERONIMO_OPTS=-Dorg.apache.geronimo.server.name=${GVIRT}
# Normal startuo
${GHOME}/bin/startup
# Interactive startup
#${GHOME}/bin/geronimo run
</pre>
</div></div></li>
		</ul>
		</li>
		<li>On linux, make the start script is executable with chmod: chmod 755 start.sh</li>
	</ul>
	</li>
	<li>Finally you can start up each instance by executing their associated start script
you just created in the previous step</li>
	<li>Your Geronimo installation file structure should look something similar to this:
<div class="preformatted panel" style="border-style: solid;border-width: 1px;"><div
class="preformattedContent panelContent">
<pre>/opt/geronimo3
|-- LICENSE
|-- NOTICE
|-- README.txt
|-- RELEASE_NOTES-3.0-SNAPSHOT.txt
|-- bin
|-- deploy
|-- etc
|-- gserv1
|   |-- etc
|   |-- repository
|   |-- start.sh
|   `-- var
|-- gserv2
|   |-- etc
|   |-- repository
|   |-- start.sh
|   `-- var
|-- hotbundles
|-- jsr88
|-- lib
|-- repository
|-- schema
`-- var
</pre>
</div></div></li>
</ul>



<h1><a name="RunningmultipleGeronimoinstances-Furtherreadings"></a>Further
readings</h1>

<p>To use multiple repositories see <a href="/confluence/display/GMOxDOC30/Configuring+multiple+repositories"
title="Configuring multiple repositories">Configuring multiple repositories</a>.</p>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Running+multiple+Geronimo+instances">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=20645442&revisedVersion=9&originalVersion=8">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Running+multiple+Geronimo+instances?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message