InstallationThis section describes how to install the Registry Service software contained in the registry-service package. The following topics can be found in this section: System RequirementsThe Registry Service was developed using Java and Jersey and will run under a standard Java Application Server. The tool was specifically developed under Sun Java version 1.6, so the tool will execute correctly under 1.6 and future versions. Since the tool was developed using Sun's Java, the target Java Application Server should support Sun's Java Runtime Environment (JRE). The application was tested using Apache's Tomcat version 6.0.X, which is the preferred Java Application Server for deployment. The software can be obtained from the Apache Tomcat web site. Other Java Application Servers should be compatible. Although it is generally a useful tool for interacting with the Registry Service, the cURL command-line application is required by the load_registry script for populating the service with the supported object types. See the Configuration section for more information. Unpacking the PackageDownload the registry-service package from the PDS FTP site. The binary distribution is available in identical zip or tar/gzip packages. Unpack the selected binary distribution file with one of the following commands: % unzip registry-service-0.7.0-bin.zip or % tar -xzvf registry-service-0.7.0-bin.tar.gz Note: Depending on the platform, the native version of tar may produce an error when attempting to unpack the distribution file because many of the file paths are greater than 100 characters. If available, the GNU version of tar will resolve this problem. If that is not available or cannot be installed, the zipped package will work just fine in a UNIX environment. The commands above result in the creation of the registry-service-0.7.0 directory with the following directory structure:
Deploying the ApplicationThe Registry Service web application is packaged as a WAR file and is intended for installation under a standard Java Application Server. Prior to installation the WAR file should be renamed from registry-service-0.7.0.war to registry.war. A WAR file is normally copied directly to the webapps directory or installed via the Manager interface. Once this step is complete, the application is ready for operation. Verify a successful installation by executing the command from the Ping portion of the Operation section. When deploying the application via the Tomcat Manager interface, users have occasionally encountered a situation where the application appears to hang or generates the following stack trace: javax.servlet.ServletException: java.lang.OutOfMemoryError: PermGen space com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:424) com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:497) com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:855) com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:828) com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:789) org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal (OpenEntityManagerInViewFilter.java:113) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) If either of the above situations occur, stop and restart the Tomcat server to clear the problem. Database ConfigurationBy default, the Registry Service comes configured to utilize Derby as the backend database. The Derby database home directory will default to the current working directory where the Apache Tomcat server was launched. To permanently set the home directory of the database, add the following to the CATALINA_OPTS environment variable: CATALINA_OPTS="-Dderby.system.home=/path/to/registrydb/home" The CATALINA_OPTS environment variable is loaded from the Apache Tomcat startup scripts. The Tomcat server will need to be restarted for this configuration to take effect. The backend database can be changed from Derby to another database provider. As of the current release, MySQL is the only other supported database provider. To modify the configuration, edit the applicationContext.xml file located in the $TOMCAT_HOME/webapps/registry/WEB-INF/classes directory. The following line: <context:property-placeholder location="classpath:derby.properties"/> should be changed to: <context:property-placeholder location="classpath:mysql.properties"/> The default configuration assumes that you have MySQL installed with a database named registry and will use a default user name and password as specified below. If you want to change the URL, database name, user name, and/or password you will need to edit the mysql.properties file located in the $TOMCAT_HOME/webapps/registry/WEB-INF/classes directory. The following lines pertain to the default configuration: javax.persistence.jdbc.url=jdbc:mysql://localhost:3306/registry javax.persistence.jdbc.user=registry javax.persistence.jdbc.password=p@ssw0rd Additionally, if you are using a version of MySQL older than 5.x you will need to change the dialect. To do this simply add a "#" before the first hibernate.dialect entry and remove the "#" from the second entry. Before: # For use with MySQL 5+ hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect # For use with older versions of MySQL. See hibernate documentation. #hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect After: # For use with MySQL 5+ #hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect # For use with older versions of MySQL. See hibernate documentation. hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect No matter which database provider is configured as the backend database, the schema that supports the Registry Service is created by default when launching the service for the first time. Home ConfigurationBy default, the registry home is configured as http://localhost:8080/registry. This should be modified to represent the end point of the target installation. To modify the configuration, edit the applicationContext.xml file located in the $TOMCAT_HOME/webapps/registry/WEB-INF/classes directory. Modify the following line with the new end point: <bean id="idGenerator" class="gov.nasa.pds.registry.model.naming.DefaultIdentifierGenerator" p:home="http://localhost:8080/registry"/> In a distributed environment with multiple Registry Service instances, the registry home value identifies the source of registered entries when replication is occurring among the instances. Configuring the ApplicationOnce the Registry Service is installed and running, the list of supported object types must be registered with the service. The list of objects types corresponds with the types of products that a given instance of the Registry Service will support. Execute the RegistryConfig script from the bin directory in order to register the full set of object types: % cd registry-service-0.7.0/bin % ./RegistryConfig The output from this command should show the registration of the Core object types and PDS object types. Since the configuration files referenced in the configuration script are slightly larger they are sent in chunks. Each configuration will get associated with a Registry Package and can be found by following the location link that comes in the header of the response. The output from the command should look something like the following: * About to connect() to localhost port 8080 (#0) * Trying ::1... connected * Connected to localhost (::1) port 8080 (#0) > POST /registry-service/configure?name=Core+Objects&\ description=This+configures+the+core+set+of+registry+objects HTTP/1.1 > User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3 > Host: localhost:8080 > Accept: */* > Content-type:application/xml > Content-Length: 5295 > Expect: 100-continue > < HTTP/1.1 100 Continue < HTTP/1.1 201 Created < Server: Apache-Coyote/1.1 < Location: http://localhost:8080/registry/packages/\ urn:uuid:bd6e4f7b-dfb0-443c-b845-3378077b1016 < Content-Type: text/plain < Transfer-Encoding: chunked < Date: Mon, 21 Mar 2011 19:55:52 GMT < * Connection #0 to host localhost left intact * Closing connection #0 urn:uuid:bd6e4f7b-dfb0-443c-b845-3378077b1016 * About to connect() to localhost port 8080 (#0) * Trying ::1... connected * Connected to localhost (::1) port 8080 (#0) > POST /registry-service/configure?name=PDS+Objects&\ description=This+configures+PDS+object+types HTTP/1.1 > User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3 > Host: localhost:8080 > Accept: */* > Content-type:application/xml > Content-Length: 18320 > Expect: 100-continue > < HTTP/1.1 100 Continue < HTTP/1.1 201 Created < Server: Apache-Coyote/1.1 < Location: http://localhost:8080/registry/packages/\ urn:uuid:a07ad134-42ad-4781-9cbd-826bb9a8dfec < Content-Type: text/plain < Transfer-Encoding: chunked < Date: Mon, 21 Mar 2011 19:55:53 GMT < * Connection #0 to host localhost left intact * Closing connection #0 urn:uuid:a07ad134-42ad-4781-9cbd-826bb9a8dfec The RegistryConfig script defaults to a Registry Service end point of http://localhost:8080/registry. If necessary, modify the script so that it corresponds with the end point of the target installation. In addition, this script should be executed prior to applying security to the service URLs since it does not account for a secured interface. Verify successful configuration by executing the command from the Report portion of the Operation section. The output from this command should look something like the following: <ns2:report xmlns:ns2='http://registry.pds.nasa.gov' registryVersion='0.7.0' packages='2' classificationNodes='67' classificationSchemes='1' services='0' extrinsics='0' associations='68' serverStarted='2011-08-28T12:45:43.514-07:00' status='OK'/>
|