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 > Configuring multiple repositories
Date Tue, 28 Feb 2012 16:42: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/Configuring+multiple+repositories">Configuring
multiple repositories</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~rglaue">Russell
E Glaue</a>
    </h4>
        <div id="versionComment">
        <b>Comment:</b>
        Updating the use of deploy to refect current functionality in Geronimo 3.0. Using
deploy for multiple Geronimo instances is broken in the recent 3.0-beta-1 release, so the
docs are updated to reflect the use of deploy for 3.0-SNAPSHOT which includes the use of the
"GERONIMO_SERVER" environment variable.<br />
    </div>
        <br/>
                         <h4>Changes (25)</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" >{code} <br># Deploy the {{repo2.xml}}
from the command prompt: <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">*{{deploy(.bat|.sh)
deploy &lt;Geronimo_HOME&gt;/repo2/repo2.xml}}* <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">*{{deploy(.bat)
deploy &lt;GERONIMO_HOME&gt;/repo2/repo2.xml}}* <br></td></tr>
            <tr><td class="diff-unchanged" >. <br>To verify that the repository
is successfully deployed, you can list the targets on the current server with the command:
<br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words">*{{deploy(.bat<span
class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">|.sh</span>)</span>
list-targets}}*, and you can see the following information: <br></td></tr>
            <tr><td class="diff-unchanged" >{noformat} <br>Available Targets:
<br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >And the resulting property would be
set to something that looks like this: <br>{code}org.ops4j.pax.url.mvn.defaultRepositories=file:${karaf.home}/repository@snapshots,file:${org.apache.geronimo.server.dir}/repo2@snapshots{code}
<br></td></tr>
            <tr><td class="diff-changed-lines" >The first defined repository is
the default and primary <span class="diff-changed-words"><span class="diff-added-chars"style="background-color:
#dfd;">*</span>GERONIMO_HOME/repository<span class="diff-added-chars"style="background-color:
#dfd;">*</span>,</span> the second one is the new <span class="diff-changed-words">*<span
class="diff-added-chars"style="background-color: #dfd;">GERONIMO_HOME/</span>repo2*</span>
repository just created. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>{note} <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >Here is an example of deploying a
sample jsp application to the repository repo2. <br> <br></td></tr>
            <tr><td class="diff-changed-lines" ># List the targets on the current
server via the command: <span class="diff-changed-words">*{{deploy(.bat<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">|.sh</span>)</span>
list-targets}}*, and you can see the following information: <br></td></tr>
            <tr><td class="diff-unchanged" >{noformat} <br>Available Targets:
<br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >org.apache.geronimo.configs/j2ee-system/2.2/car?ServiceModule=org.apache.geronimo.configs/j2ee-system/2.2/car,j2eeType=ConfigurationStore,name=Local
<br>{noformat} <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">#
Set the environment variable REPO2: <br>On a Windows system *set REPO2=org.example.configs/myrepo/2.2/car?ServiceModule=org.example.configs/myrepo/2.2/car,j2eeType=ConfigurationStore,name=Local2*
          <br>On  a non-Windows system *export REPO2=org.example.configs/myrepo/2.2/car?ServiceModule=org.example.configs/myrepo/2.2/car,j2eeType=ConfigurationStore,name=Local2*
   <br># Deploy the application to the repository repo2 with the following deploy (.bat
or .sh) command:  <br>On a Windows system *deploy.bat deploy --targets %REPO2% &lt;SAMPLE_HOME&gt;/applications/geronimo-jsp-examples/target/geronimo-jsp-examples-2.2.war*
<br>On  a non-Windows system *deploy.sh deploy --targets $REPO2 &lt;SAMPLE_HOME&gt;/applications/geronimo-jsp-examples/target/geronimo-jsp-examples-2.2.war*
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">#
Deploy the application to the repository repo2, named as &quot;Local2&quot; with the
following deploy command:  <br>- On a Windows system: <br> *deploy.bat deploy
--targets Local2 &lt;SAMPLE_HOME&gt;/applications/geronimo-jsp-examples/target/geronimo-jsp-examples-2.2.war*
<br>- On a non-Windows system: <br> *deploy deploy --targets Local2 &lt;SAMPLE_HOME&gt;/applications/geronimo-jsp-examples/target/geronimo-jsp-examples-2.2.war*
<br></td></tr>
            <tr><td class="diff-unchanged" >where &lt;SAMPLE_HOME&gt;
is the directory of your samples. Then, the jsp example is deployed to the new repository
repo2. The following message is displayed: <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words">{noformat}<span
class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">Deployed</span></span>
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">
   Deployed org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war @ /jsp-examples
<br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war</span>
<span class="diff-added-words"style="background-color: #dfd;">{noformat}</span>
<br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">@
/jsp-examples{noformat} <br># Access the application at http://{_}host{_}:_port_/jsp-examples.
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">#
Access the application at http:// &lt; host &gt; : &lt; port &gt; /jsp-examples.
<br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-added-words"style="background-color:
#dfd;">#</span> To undeploy the application from the repository repo2, run the following
deploy <span class="diff-changed-words">(.bat<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">
or .sh</span>)</span> command: <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">On
a Windows system *deploy.bat undeploy &quot;%REPO2%|org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war&quot;*
<br>On  a non-Windows system *deploy.sh undeploy &quot;$REPO2|org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war&quot;*
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">-
On a Windows system: <br> *deploy.bat undeploy &quot;org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war&quot;*
<br>- On a non-Windows system: <br> *deploy undeploy &quot;org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war&quot;*
<br>{noformat} <br>    Module org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war
unloaded. <br>    Module org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war
uninstalled. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">
   Undeployed org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war <br>{noformat}
<br></td></tr>
            <tr><td class="diff-unchanged" > <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" ># Create a file {{repo22.xml}} under
the {{&lt;geronimo_home&gt;/repo22}} directory. For detailed information about the
file, see [creating multiple repositories|#Creating multiple repositories on a single server
instance|creating multiple repositories]. <br># Deploy the {{repo22.xml}} by running
the following command from the command prompt: <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">*{{deploy(.bat|.sh)
-port {_}instance2_RMI_port{_} deploy &lt;geronimo_home&gt;/server2/repo22/repo22.xml}}*
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">-
using non-Windows: <br> *export GERONIMO_SERVER=server2* <br> *{{deploy -port
{_}instance2_RMI_port{_} deploy $GERONIMO_HOME/server2/repo22/repo22.xml}}* <br>- using
Windows <br> *set GERONIMO_SERVER &quot;server2&quot;* <br> *{{deploy.bat
-port {_}instance2_RMI_port{_} deploy %GERONIMO_HOME%/server2/repo22/repo22.xml}}* <br></td></tr>
            <tr><td class="diff-unchanged" > <br>You can follow the same
steps to create repositories for server instance3. <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >To test the repository that you create,
you can deploy a sample application to and undeploying it from the repository. <br>
<br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">#
Set the environment variable repo22 for the repository repo22 that you have previously created.
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">#
Note the repository name for the repository repo22 that you have previously created. We&#39;ll
assume the name is Local22. <br></td></tr>
            <tr><td class="diff-changed-lines" ># Deploy the application to the
repository repo2 with the following <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">deploy
(.bat or .sh)</span> <span class="diff-added-words"style="background-color: #dfd;">deploy(.bat)</span>
command: <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">On
a Windows system *deploy.bat -port {_}instance2_RMI_port{_} deploy --targets %repo22% &lt;SAMPLE_HOME&gt;/applications/geronimo-jsp-examples/target/geronimo-jsp-examples-2.2.war*
<br>On  a non-Windows system *deploy.sh -port {_}instance2_RMI_port{_} deploy --targets
$repo22 &lt;SAMPLE_HOME&gt;/applications/geronimo-jsp-examples/target/geronimo-jsp-examples-2.2.war*
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">-
On a non-Windows system: <br> *export GERONIMO_SERVER=server2* <br> *deploy -port
{_}instance2_RMI_port{_} deploy --targets Local22 &lt;SAMPLE_HOME&gt;/applications/geronimo-jsp-examples/target/geronimo-jsp-examples-2.2.war*
<br>- On a Windows system: <br> *set GERONIMO_SERVER &quot;server2&quot;*
<br> *deploy.bat -port {_}instance2_RMI_port{_} deploy --targets Local22 &lt;SAMPLE_HOME&gt;/applications/geronimo-jsp-examples/target/geronimo-jsp-examples-2.2.war*
<br></td></tr>
            <tr><td class="diff-unchanged" ># Undeploy the jsp application from
repo22 repository with the following command: <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">On
a Windows system  *deploy.bat -port {_}instance2_RMI_port{_} undeploy %repo22%|org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war*
 <br>On  a non-Windows system  *deploy.sh -port {_}instance2_RMI_port{_} undeploy $repo22|org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war*
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">-
On a non-Windows system: <br> *export GERONIMO_SERVER=server2* <br> *deploy -port
{_}instance2_RMI_port{_} undeploy org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war*
<br>- On a Windows system: <br> *set GERONIMO_SERVER &quot;server2&quot;*
<br> *deploy.bat -port {_}instance2_RMI_port{_} undeploy org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war*
 <br></td></tr>
            <tr><td class="diff-unchanged" > <br>You can follow the same
steps to deploy applications to and undeploy applications from repositories on server instance3.
<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/Configuring+JMS+resources"><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/Configuring+JMS+resources">Configuring
JMS resources</a>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a
href="/confluence/display/GMOxDOC30/Configuring+services"><img border='0' align='middle'
src='/confluence/images/icons/up_16.gif' width='8' height='8'></a></sup><a
href="/confluence/display/GMOxDOC30/Configuring+services">Configuring services</a></td><td
width='33%' class='ScrollbarNextName'>&nbsp;</td></tr></table></div>

<p>The advantage of having multiple repositories is that they can reside on different
server instances. You can create multiple repositories on different server instances, deploy
a single repository on a single server instance, and deploy applications on multiple repositories
on a single server instance.</p>

<p>This topic includes the following information:</p>
<div>
<ul>
    <li><a href='#Configuringmultiplerepositories-Creatingmultiplerepositoriesonasingleserverinstance'>Creating
multiple repositories on a single server instance</a></li>
<ul>
    <li><a href='#Configuringmultiplerepositories-Creatingarepositorybesidesthedefaultrepository'>Creating
a repository besides the default repository</a></li>
    <li><a href='#Configuringmultiplerepositories-Deployinganapplicationtotherepository'>Deploying
an application to the repository</a></li>
</ul>
    <li><a href='#Configuringmultiplerepositories-Creatingmultiplerepositoriesonmultipleserverinstances'>Creating
multiple repositories on multiple server instances</a></li>
<ul>
    <li><a href='#Configuringmultiplerepositories-Creatingarepositoryforserverinstance2'>Creating
a repository for server instance2</a></li>
    <li><a href='#Configuringmultiplerepositories-Deployingasampleapplicationtoandundeployingitfromtherepository'>Deploying
a sample application to and undeploying it from the repository</a></li>
</ul>
</ul></div>

<p>As an alternative to the steps in this section, a <b>server-repo</b>
plugin is available to perform this configuration for you. Visit the <a href="/confluence/display/GMOxDOC30/Samples"
title="Samples">Samples</a> section for further details.</p>

<h1><a name="Configuringmultiplerepositories-Creatingmultiplerepositoriesonasingleserverinstance"></a>Creating
multiple repositories on a single server instance</h1>

<p>You can create multiple repositories on Geronimo. You can add a second repository
to deploy your applications and leave Geronimo in its default repository.</p>

<h2><a name="Configuringmultiplerepositories-Creatingarepositorybesidesthedefaultrepository"></a>Creating
a repository besides the default repository</h2>

<p>To add a second repository besides the default repository, take the following steps:</p>

<ol>
	<li>Start Geronimo.</li>
	<li>Create a directory repo2 under <tt>&lt;geronimo_home&gt;</tt>,
for example, <tt>&lt;geronimo_home&gt;/repo2</tt>.</li>
	<li>Create a file <tt>repo2.xml</tt> under the <tt>&lt;geronimo_home&gt;/repo2</tt>
directory, for example:
<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>repo2.xml</b></div><div
class="codeContent panelContent">
<pre class="code-java">
&lt;module xmlns=<span class="code-quote">"http:<span class="code-comment">//geronimo.apache.org/xml/ns/deployment-1.2"</span>&gt;
</span> &lt;environment&gt;
  &lt;moduleId&gt;
   &lt;groupId&gt;org.example.configs&lt;/groupId&gt;
    &lt;artifactId&gt;myrepo&lt;/artifactId&gt;
    &lt;version&gt;2.2&lt;/version&gt;
    &lt;type&gt;car&lt;/type&gt;
  &lt;/moduleId&gt;
  &lt;dependencies&gt;
   &lt;dependency&gt;
    &lt;groupId&gt;org.apache.geronimo.framework&lt;/groupId&gt;
    &lt;artifactId&gt;j2ee-system&lt;/artifactId&gt;
    &lt;type&gt;car&lt;/type&gt;
   &lt;/dependency&gt;
  &lt;/dependencies&gt;
  &lt;hidden-classes/&gt;
  &lt;non-overridable-classes/&gt;
 &lt;/environment&gt;
 &lt;gbean name=<span class="code-quote">"Repo2"</span> class=<span class="code-quote">"org.apache.geronimo.system.repository.Maven2Repository"</span>&gt;
   &lt;attribute name=<span class="code-quote">"root"</span>&gt;repo2/&lt;/attribute&gt;
   &lt;attribute name=<span class="code-quote">"resolveToServer"</span>&gt;<span
class="code-keyword">false</span>&lt;/attribute&gt;
   &lt;reference name=<span class="code-quote">"ServerInfo"</span>&gt;
    &lt;name&gt;ServerInfo&lt;/name&gt;
   &lt;/reference&gt;
 &lt;/gbean&gt;
 &lt;gbean name=<span class="code-quote">"Local2"</span> class=<span class="code-quote">"org.apache.geronimo.system.configuration.RepositoryConfigurationStore"</span>&gt;
  &lt;reference name=<span class="code-quote">"Repository"</span>&gt;
   &lt;name&gt;Repo2&lt;/name&gt;
  &lt;/reference&gt;
 &lt;/gbean&gt;
&lt;/module&gt;
</pre>
</div></div></li>
	<li>Deploy the <tt>repo2.xml</tt> from the command prompt:<br/>
<b><tt>deploy(.bat) deploy &lt;GERONIMO_HOME&gt;/repo2/repo2.xml</tt></b><br/>
.<br/>
To verify that the repository is successfully deployed, you can list the targets on the current
server with the command:<br/>
<b><tt>deploy(.bat) list-targets</tt></b>, and you can see the following
information:
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>Available Targets:
  org.apache.geronimo.framework/j2ee-system/2.2/car?ServiceModule=org.apache.geronimo.framework/j2ee-system/2.2/car,j2eeType=ConfigurationStore,name=Local
  org.example.configs/myrepo/2.2/car?ServiceModule=org.example.configs/myrepo/2.2/car,j2eeType=ConfigurationStore,name=Local2
</pre>
</div></div></li>
	<li>Update the <tt>etc/org.ops4j.pax.url.mvn.cfg</tt> file, add the new
second repository to the <tt>org.ops4j.pax.url.mvn.defaultRepositories</tt> property<br/>
The property <tt>org.ops4j.pax.url.mvn.defaultRepositories</tt> maintains a comma-delimited
list of repositories that are used by the run-time server.<br/>
The format is: <tt>file:</tt> &lt; <em>/absolute/path/to/repo2</em>
&gt; <tt>@snapshots</tt><br/>
And if a variable it used, the new repository just deployed would be defined as:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">file:${org.apache.geronimo.server.dir}/repo2@snapshots</pre>
</div></div>
<p>And the resulting property would be set to something that looks like this:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">org.ops4j.pax.url.mvn.defaultRepositories=file:${karaf.home}/repository@snapshots,file:${org.apache.geronimo.server.dir}/repo2@snapshots</pre>
</div></div>
<p>The first defined repository is the default and primary <b>GERONIMO_HOME/repository</b>,
the second one is the new <b>GERONIMO_HOME/repo2</b> repository just created.</p></li>
</ol>


<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>In Geronimo 3.0, there is a minor
bug that exists when creating additional repositories for Geronimo instances. The files <tt>GERONIMO_HOME/var/config/config.xml</tt>
and <tt>GERONIMO_HOME/var/config/config-substitutions.properties</tt> must exist
even though they are never used, otherwise Geronimo will fail complaining that they do not
exist. Simply create these files, or copy them from <tt>GERONIMO_SERVER/var/config/...</tt>
to work around this issue.

<p>See <a href="https://issues.apache.org/jira/browse/GERONIMO-6284" class="external-link"
rel="nofollow">GERONIMO-6284</a> for details.</p></td></tr></table></div>


<h2><a name="Configuringmultiplerepositories-Deployinganapplicationtotherepository"></a>Deploying
an application to the repository</h2>

<p>Here is an example of deploying a sample jsp application to the repository repo2.</p>

<ol>
	<li>List the targets on the current server via the command: <b><tt>deploy(.bat)
list-targets</tt></b>, and you can see the following information:
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>Available Targets:
org.example.configs/myrepo/2.2/car?ServiceModule=org.example.configs/myrepo/2.2/car,j2eeType=ConfigurationStore,name=Local2
org.apache.geronimo.configs/j2ee-system/2.2/car?ServiceModule=org.apache.geronimo.configs/j2ee-system/2.2/car,j2eeType=ConfigurationStore,name=Local
</pre>
</div></div></li>
	<li>Deploy the application to the repository repo2, named as "Local2" with the following
deploy command:</li>
</ol>
<ul class="alternate" type="square">
	<li>On a Windows system:<br/>
 <b>deploy.bat deploy --targets Local2 &lt;SAMPLE_HOME&gt;/applications/geronimo-jsp-examples/target/geronimo-jsp-examples-2.2.war</b></li>
	<li>On a non-Windows system:<br/>
 <b>deploy deploy --targets Local2 &lt;SAMPLE_HOME&gt;/applications/geronimo-jsp-examples/target/geronimo-jsp-examples-2.2.war</b><br/>
where &lt;SAMPLE_HOME&gt; is the directory of your samples. Then, the jsp example
is deployed to the new repository repo2. The following message is displayed:
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>    Deployed org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war
@ /jsp-examples
</pre>
</div></div></li>
</ul>
<ol>
	<li>Access the application at http:// &lt; host &gt; : &lt; port &gt;
/jsp-examples.</li>
</ol>


<ol>
	<li>To undeploy the application from the repository repo2, run the following deploy
(.bat) command:</li>
</ol>
<ul class="alternate" type="square">
	<li>On a Windows system:<br/>
 <b>deploy.bat undeploy "org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war"</b></li>
	<li>On a non-Windows system:<br/>
 <b>deploy undeploy "org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war"</b>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>    Module org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war
unloaded.
    Module org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war uninstalled.

    Undeployed org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war
</pre>
</div></div></li>
</ul>



<h1><a name="Configuringmultiplerepositories-Creatingmultiplerepositoriesonmultipleserverinstances"></a>Creating
multiple repositories on multiple server instances</h1>

<p>Create several server instances, and start the server instances. For information
about creating server instances, see <a href="/confluence/display/GMOxDOC30/Running+multiple+Geronimo+instances"
title="Running multiple Geronimo instances">Running multiple Geronimo instances</a>.
Then you need to create several repositories on these server instances. You can test the repositories
by deploying an application to these server instances and undeploying the application from
these server instances.</p>


<h2><a name="Configuringmultiplerepositories-Creatingarepositoryforserverinstance2"></a>Creating
a repository for server instance2</h2>

<p>After you create more than one server instance, you can create repositories and deploy
the repositories to different server instances. For information about how to create and deploy
a repository on a server instance, see the following example that creates repo22 and deploys
it on server2:</p>
<ol>
	<li>Create a directory repo22 under <tt>&lt;geronimo_home&gt;</tt>,
for example, <tt>&lt;geronimo_home&gt;/repo22</tt>.</li>
	<li>Create a file <tt>repo22.xml</tt> under the <tt>&lt;geronimo_home&gt;/repo22</tt>
directory. For detailed information about the file, see <a href="#Configuringmultiplerepositories-Creatingmultiplerepositoriesonasingleserverinstance"
title="creating multiple repositories">creating multiple repositories</a>.</li>
	<li>Deploy the <tt>repo22.xml</tt> by running the following command from
the command prompt:</li>
</ol>
<ul class="alternate" type="square">
	<li>using non-Windows:<br/>
 <b>export GERONIMO_SERVER=server2</b><br/>
 <b><tt>deploy -port <em>instance2_RMI_port</em> deploy $GERONIMO_HOME/server2/repo22/repo22.xml</tt></b></li>
	<li>using Windows<br/>
 <b>set GERONIMO_SERVER "server2"</b><br/>
 <b><tt>deploy.bat -port <em>instance2_RMI_port</em> deploy %GERONIMO_HOME%/server2/repo22/repo22.xml</tt></b></li>
</ul>


<p>You can follow the same steps to create repositories for server instance3.</p>

<h2><a name="Configuringmultiplerepositories-Deployingasampleapplicationtoandundeployingitfromtherepository"></a>Deploying
a sample application to and undeploying it from the repository</h2>

<p>To test the repository that you create, you can deploy a sample application to and
undeploying it from the repository.</p>

<ol>
	<li>Note the repository name for the repository repo22 that you have previously created.
We'll assume the name is Local22.</li>
	<li>Deploy the application to the repository repo2 with the following deploy(.bat)
command:</li>
</ol>
<ul class="alternate" type="square">
	<li>On a non-Windows system:<br/>
 <b>export GERONIMO_SERVER=server2</b><br/>
 <b>deploy -port <em>instance2_RMI_port</em> deploy --targets Local22 &lt;SAMPLE_HOME&gt;/applications/geronimo-jsp-examples/target/geronimo-jsp-examples-2.2.war</b></li>
	<li>On a Windows system:<br/>
 <b>set GERONIMO_SERVER "server2"</b><br/>
 <b>deploy.bat -port <em>instance2_RMI_port</em> deploy --targets Local22
&lt;SAMPLE_HOME&gt;/applications/geronimo-jsp-examples/target/geronimo-jsp-examples-2.2.war</b></li>
</ul>
<ol>
	<li>Undeploy the jsp application from repo22 repository with the following command:</li>
</ol>
<ul class="alternate" type="square">
	<li>On a non-Windows system:<br/>
 <b>export GERONIMO_SERVER=server2</b><br/>
 <b>deploy -port <em>instance2_RMI_port</em> undeploy org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war</b></li>
	<li>On a Windows system:<br/>
 <b>set GERONIMO_SERVER "server2"</b><br/>
 <b>deploy.bat -port <em>instance2_RMI_port</em> undeploy org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war</b>
</li>
</ul>


<p>You can follow the same steps to deploy applications to and undeploy applications
from repositories on server instance3.</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/Configuring+multiple+repositories">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=20645461&revisedVersion=7&originalVersion=6">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Configuring+multiple+repositories?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message