wiki:PetascopeEmbedded

Version 3 (modified by pbaumann, 22 months ago) (diff)

--

Embedded petascope with Jetty (Alpha phase)

Overview

Jetty is a Web server and javax.servlet container which can be bundled with an application. Petascope can be deployed with a standard servlet container like tomcat, or it can make use of the bundled jetty container to run out of the box without any further installation and configuration.

Start: Following successful installation of rasdaman with jetty enabled, the petascope Web service gets automatically started by the general rasdaman launch script start_rasdaman.sh.

Service URLs: After successful start, petascope accepts requests according to OGC W*S standards at http://localhost:8080/rasdaman/ows. Further, the SECORE Coordinate Reference System Resolver (CRS) service is available at http://localhost:8080/def.

Stop: The petascope/jetty service gets stopped by stop_rasdaman.sh *if* it has been started through start_rasdaman.sh. When started independently, petascope will have to be stopped independently.

How to change port?

By default, jetty uses port 8080. This can be changed by editing the petascope configuration file, $RMANHOME/etc/petascope.properties. Open the file in a text editor and find the line

jetty_port=8080

Change this to the desired port, save the file, and restart jetty.

How to change the petascope extraction folder?

By default, jetty extracts files from rasdaman.war and def.war (~100 MB) into $RMANHOME/share/rasdaman/war/jetty_tmp. This directory can be changed as follows. Edit the petascope configuration file, $RMANHOME/etc/petascope.properties. Open the file in a text editor and find the line

jetty_extracted_path=

By default, this setting is empty making jetty use the default folder $RMANHOME/share/rasdaman/war/jetty_tmp. Add an absolute path, such as:

jetty_extracted_path=/tmp/petascope-jetty'

and restart petascope.

Troubleshooting

Q: Cannot start petascope/jetty to listen for Web requests.

  • A: Most likely, the petascope port is in use by another web service application program. See above for changing the petascope port.

Q: My port number and/or extraction directory settings are not recognized, petascope still uses the defaults.

  • A: Assignments in the petascope configuration file, petascope.properties, must not contain any white space before or after the '='; for example, jetty_port =8080 and jetty_port = 8080 are both invalid. Further, no comment after the end of the assignment is allowed.

Q: How can I check whether jetty is up and running?

  • A: You can check the process table, and contact the service endpoint to see whether it gives a response:
    ps -ef | grep asdaman/war/jetty.jar
    wget http://localhost:8080/rasdaman/ows 
    

For developers

In the download directory, jetty is located in rasdaman folder $RMANHOME/applications/petascope/jetty. This folder contains:

  • def.war # this is the CRS (Coordinate Reference System) for Petascope.
  • jetty.jar # this is Jetty Servlet application is embedded to Petascope Web application.
  • README.txt # a file to help you how to build Jetty embedded with Petascope with java JDK by manually. (User need to copy file rasdaman.war (View 3.2 above) to this directory to run it).
  • start_petascope.class # a compiled java application to start Jetty with Petascope (view README.txt to see how to run this application).
  • start_petascope.java # a java source code application to start Jetty with Petascope (user could change port, extracted temporary folder of Jetty, view README.txt to see how to compile this application).

The configuration and make install process produces $RMANHOME/share/rasdaman/war/rasdaman.war.

Rebuilding petascope manually can be done as follows (after having run './configure' in $RMANHOME):

   cd $RMANHOME/applications/petascope/
   make  # this will rebuild Petascope and create rasdaman.war file in folder YourDownloadedPath/rasdaman/applications/petascope/build/dist (*)
   make install # this will copy Jetty files in folder YourDownloadedPath/rasdaman/applications/petascope/jetty with rasdaman.war in (*) to default folder for Petascope and Jetty (NOTE: now is: /usr/local/rasdaman)