|
| Home > Apache Geronimo v2.2 > Documentation > Configuring and administering > Configuring services > Configuring multiple repositories |
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.
This document is organized into the following sections:
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.
You can create multiple repositories on Geronimo. You can add a second repository to deploy your applications and leave Geronimo in its default repository.
To add a second repository besides the default repository, take the following steps:
<module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2"> <environment> <moduleId> <groupId>org.example.configs</groupId> <artifactId>myrepo</artifactId> <version>2.2</version> <type>car</type> </moduleId> <dependencies> <dependency> <groupId>org.apache.geronimo.framework</groupId> <artifactId>j2ee-system</artifactId> <version>2.2</version> <type>car</type> </dependency> </dependencies> <hidden-classes/> <non-overridable-classes/> </environment> <gbean name="Repo2" class="org.apache.geronimo.system.repository.Maven2Repository"> <attribute name="root">repo2/</attribute> <attribute name="resolveToServer">false</attribute> <reference name="ServerInfo"> <name>ServerInfo</name> </reference> </gbean> <gbean name="Local2" class="org.apache.geronimo.system.configuration.RepositoryConfigurationStore"> <reference name="Repository"> <name>Repo2</name> </reference> </gbean> </module>
To verify that the repository is successfully deployed, you can list the targets on the current server via the command:
deploy(.bat|.sh) list-targets, and you can see the following information:
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
Here is an example of deploying a sample jsp application to the repository repo2.
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
Deployed org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war @ /jsp-examples
To undeploy the application from the repository repo2, run the following deploy (.bat or .sh) command:
On a Windows system deploy.bat undeploy "%REPO2%|org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war"
On a non-Windows system deploy.sh undeploy "$REPO2|org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war"
You first need to create 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 it and undeploying the application from them.
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.
You can follow the same steps to create repositories for server instance3.
To test the repository that you create, you can deploy a sample application to and undeploying it from the repository.
You can follow the same steps to deploy applications to and undeploy applications from repositories on server instance3.
|
|
Privacy Policy - Copyright © 2003-2011, The Apache Software Foundation, Licensed under ASL 2.0. |