geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Geronimo v2.2 > Configuring multiple repositories
Date Thu, 23 Feb 2012 16:26:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/1/_/styles/combined.css?spaceKey=GMOxDOC22&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/GMOxDOC22/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>
        revert last change in G2.2 doc<br />
    </div>
        <br/>
                         <h4>Changes (1)</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" >    &lt;groupId&gt;org.apache.geronimo.framework&lt;/groupId&gt;
<br>    &lt;artifactId&gt;j2ee-system&lt;/artifactId&gt; <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">
   &lt;version&gt;2.2&lt;/version&gt;  <br></td></tr>
            <tr><td class="diff-unchanged" >    &lt;type&gt;car&lt;/type&gt;
<br>   &lt;/dependency&gt; <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/GMOxDOC22/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/GMOxDOC22/Configuring+JMS+resources">Configuring
JMS resources</a>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a
href="/confluence/display/GMOxDOC22/Configuring+services"><img border='0' align='middle'
src='/confluence/images/icons/up_16.gif' width='8' height='8'></a></sup><a
href="/confluence/display/GMOxDOC22/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 document is organized into the following sections:</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 provided in this section, there is a <b>server-repo</b>
plugin available that can perform this configuration for you. Visit the <a href="/confluence/display/GMOxDOC22/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;version&gt;2.2&lt;/version&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|.sh) deploy &lt;Geronimo_HOME&gt;/repo2/repo2.xml</tt></b></li>
</ol>


<p>To verify that the repository is successfully deployed, you can list the targets
on the current server via the command:<br/>
<b><tt>deploy(.bat|.sh) list-targets</tt></b>, and you can see the
following information:</p>
<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>


<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|.sh)
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>Set the environment variable REPO2:<br/>
On a Windows system <b>set REPO2=org.example.configs/myrepo/2.2/car?ServiceModule=org.example.configs/myrepo/2.2/car,j2eeType=ConfigurationStore,name=Local2</b>
         <br/>
On  a non-Windows system <b>export REPO2=org.example.configs/myrepo/2.2/car?ServiceModule=org.example.configs/myrepo/2.2/car,j2eeType=ConfigurationStore,name=Local2</b>
  </li>
	<li>Deploy the application to the repository repo2 via the following deploy (.bat or
.sh) command:<br/>
On a Windows system <b>deploy.bat deploy --targets %REPO2% &lt;SAMPLE_HOME&gt;/applications/geronimo-jsp-examples/target/geronimo-jsp-examples-2.2.war</b><br/>
On  a non-Windows system <b>deploy.sh deploy --targets $REPO2 &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>
	<li>Access the application via http://<em>host</em>:<em>port</em>/jsp-examples.</li>
</ol>


<p>To undeploy the application from the repository repo2, run the following deploy (.bat
or .sh) command:<br/>
On a Windows system <b>deploy.bat undeploy "%REPO2%|org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war"</b><br/>
On  a non-Windows system <b>deploy.sh undeploy "$REPO2|org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war"</b></p>


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

<p>You first need to create several server instances, and start the server instances.
For information about creating server instances, see <a href="/confluence/display/GMOxDOC22/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 it and undeploying the application from them.</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, for example, create repo22 and deploy 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:<br/>
<b><tt>deploy(.bat|.sh) -port <em>instance2_RMI_port</em> deploy &lt;geronimo_home&gt;/server2/repo22/repo22.xml</tt></b></li>
</ol>


<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>Set the environment variable repo22 for the repository repo22 that you have previously
created.</li>
	<li>Deploy the application to the repository repo2 via the following deploy (.bat or
.sh) command:<br/>
On a Windows system <b>deploy.bat -port <em>instance2_RMI_port</em> deploy
--targets %repo22% &lt;SAMPLE_HOME&gt;/applications/geronimo-jsp-examples/target/geronimo-jsp-examples-2.2.war</b><br/>
On  a non-Windows system <b>deploy.sh -port <em>instance2_RMI_port</em>
deploy --targets $repo22 &lt;SAMPLE_HOME&gt;/applications/geronimo-jsp-examples/target/geronimo-jsp-examples-2.2.war</b></li>
	<li>Undeploy the jsp application from repo22 repository via the following command:<br/>
On a Windows system  <b>deploy.bat -port <em>instance2_RMI_port</em> undeploy
%repo22%|org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war</b>
<br/>
On  a non-Windows system  <b>deploy.sh -port <em>instance2_RMI_port</em>
undeploy $repo22|org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war</b></li>
</ol>


<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/GMOxDOC22/Configuring+multiple+repositories">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=93326&revisedVersion=14&originalVersion=13">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC22/Configuring+multiple+repositories?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message