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 Mon, 31 Jan 2011 01:33:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2036/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/~maojia508">maojia</a>
    </h4>
        <br/>
                         <h4>Changes (10)</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" >{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-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">This
document is organized into the following sections: <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">This
topic includes the following information: <br></td></tr>
            <tr><td class="diff-unchanged" >{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 provided in this section, there is a *server-repo* plugin available
that can perform this configuration for you. Visit the [Samples] section for further details.
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">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" >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></td></tr>
            <tr><td class="diff-changed-lines" ># Deploy the application to the
repository repo2 <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">via</span>
<span class="diff-added-words"style="background-color: #dfd;">with</span> the
following deploy (.bat or .sh) command: <br></td></tr>
            <tr><td class="diff-unchanged" >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-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war
<br>@ /jsp-examples{noformat} <br></td></tr>
            <tr><td class="diff-changed-lines" ># Access the application <span
class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">via</span>
<span class="diff-added-words"style="background-color: #dfd;">at</span> http://{_}host{_}:_port_/jsp-examples.
<br></td></tr>
            <tr><td class="diff-unchanged" > <br>To undeploy the application
from the repository repo2, run the following deploy (.bat or .sh) command: <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >h1. Creating multiple repositories
on multiple server instances <br> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">You
first need to create</span> <span class="diff-added-words"style="background-color:
#dfd;">Create</span> several server instances, and start the server instances. For
information about creating server instances, see [Running multiple Geronimo instances]. Then
you need to create several repositories on these server instances. You can test the repositories
by deploying an application to <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">it</span>
<span class="diff-added-words"style="background-color: #dfd;">these server instances</span>
and undeploying the application from <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">them.</span>
<span class="diff-added-words"style="background-color: #dfd;">these server instances.</span>
<br></td></tr>
            <tr><td class="diff-unchanged" > <br> <br>h2. Creating
a repository for server instance2 <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >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,
<span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">for
example, create</span> <span class="diff-added-words"style="background-color: #dfd;">see
the following example that creates</span> repo22 and <span class="diff-changed-words">deploy<span
class="diff-added-chars"style="background-color: #dfd;">s</span></span> it
on <span class="diff-changed-words">server2<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">.</span><span
class="diff-added-chars"style="background-color: #dfd;">:</span></span> <br></td></tr>
            <tr><td class="diff-unchanged" ># Create a directory repo22 under
{{&lt;geronimo_home&gt;}}, for example, {{&lt;geronimo_home&gt;/repo22}}.
<br># 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></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br># Set the environment variable
repo22 for the repository repo22 that you have previously created. <br></td></tr>
            <tr><td class="diff-changed-lines" ># Deploy the application to the
repository repo2 <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">via</span>
<span class="diff-added-words"style="background-color: #dfd;">with</span> the
following deploy (.bat or .sh) command: <br></td></tr>
            <tr><td class="diff-unchanged" >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-changed-lines" ># Undeploy the jsp application
from repo22 repository <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">via</span>
<span class="diff-added-words"style="background-color: #dfd;">with</span> the
following command: <br></td></tr>
            <tr><td class="diff-unchanged" >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-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>

<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;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 with 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 at 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>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:<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 with 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 with 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/GMOxDOC30/Configuring+multiple+repositories">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=20645461&revisedVersion=3&originalVersion=2">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