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 Thu, 01 Mar 2012 18:32: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>
        Updated to reflect that each instance have a local repository, and notice added about
updated support.<br />
    </div>
        <br/>
                         <h4>Changes (5)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-unchanged" >{scrollbar} <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">{note}
<br>Regarding both Geronimo javaee6 and minimal release bundles. Full support for multiple
repositories was completed in [GERONIMO-6270|https://issues.apache.org/jira/browse/GERONIMO-6270]
and its sub-tasks. This support is available in the latest snapshots after March 1, 2012,
and will be in the 3.0-beta-2 standard release. This documents how to setup multiple repositories
after applying the changes from GERONIMO-6270. <br> <br>For prior releases, this
document can still be followed if the {{org.ops4j.pax.url.mvn.defaultRepositories}} property
is set properly, described in this document. <br>{note} <br> <br> <br></td></tr>
            <tr><td class="diff-unchanged" >{excerpt}The advantage of having multiple
repositories is that they can reside on different server instances.{excerpt} 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.
<br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">For
multiple instance support within a single Geronimo installation, it is recommended that each
instance have its own local repository for deploying to (i.e. {{GERONIMO_SERVER/repository}}).
The primary shared repository ({{GERONIMO_HOME/repository}}) in a multiple instance configuration
should remain read-only. <br> <br></td></tr>
            <tr><td class="diff-unchanged" >This topic includes the following
information: <br>{toc} <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">As
an alternative to the steps in this section, a *server-repo* plugin is available to perform
this configuration for you. Visit the [Samples] section for further details. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>h1. Creating multiple repositories
on a single server instance <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >The first defined repository is the
default and primary *GERONIMO_HOME/repository*, the second one is the new *GERONIMO_HOME/repo2*
repository just created. <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">{note}
<br>In Geronimo 3.0, there is a minor bug that exists when creating additional repositories
for Geronimo instances. The files {{GERONIMO_HOME/var/config/config.xml}} and {{GERONIMO_HOME/var/config/config-substitutions.properties}}
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 {{GERONIMO_SERVER/var/config/...}}
to work around this issue. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">See
[GERONIMO-6284|https://issues.apache.org/jira/browse/GERONIMO-6284] for details. <br>{note}
<br> <br> <br></td></tr>
            <tr><td class="diff-unchanged" >h2.Deploying an application to the
repository <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/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>

<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>Regarding both Geronimo javaee6
and minimal release bundles. Full support for multiple repositories was completed in <a
href="https://issues.apache.org/jira/browse/GERONIMO-6270" class="external-link" rel="nofollow">GERONIMO-6270</a>
and its sub-tasks. This support is available in the latest snapshots after March 1, 2012,
and will be in the 3.0-beta-2 standard release. This documents how to setup multiple repositories
after applying the changes from GERONIMO-6270.

<p>For prior releases, this document can still be followed if the <tt>org.ops4j.pax.url.mvn.defaultRepositories</tt>
property is set properly, described in this document.</p></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>For multiple instance support within a single Geronimo installation, it is recommended
that each instance have its own local repository for deploying to (i.e. <tt>GERONIMO_SERVER/repository</tt>).
The primary shared repository (<tt>GERONIMO_HOME/repository</tt>) in a multiple
instance configuration should remain read-only.</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>


<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>



<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;/server2</tt>,
for example, <tt>&lt;geronimo_home&gt;/server2/repo22</tt>.</li>
	<li>Create a file <tt>repo22.xml</tt> under the <tt>&lt;geronimo_home&gt;/server2/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 repo22 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=10&originalVersion=9">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