wiki:PetascopeEmbedded

Version 2 (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.

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

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.

How to run petascope with jetty

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.

How to start Jetty embedded with Petascope?

How to stop Jetty embedded with Petascope?

Once again, when you stop rasdaman by running script stop_rasdaman.sh (default is in /usr/local/rasdaman/bin/stop_rasdaman.sh), this script will check Jetty embedded with Petascope has been started or not, then kill this process (NOTE: it will not kill your own Jetty process or your Jetty embedded with Petascope started manually).

   To stop rasdaman server, in terminal type: stop_rasdaman.sh

How could I change port and extracter files of Jetty embedded with Petascope folder?

Default, Jetty embedded will use port '8080' and a folder to extracted file from 'rasdaman.war' and 'def.war' (default is: '/usr/local/rasdaman/share/rasdaman/war/jetty_tmp' ~ 100 MB). However, user could change port and this temporary folder if he or she want:

   Instead of recompiling file start_rasdaman.java in 'Downloaded Rasdaman source code (View 3.3)', user just need to change the parameters in the file '$RMANHOME/install/etc/petascope.properties' ('''NOTE:''' user must 'make' and 'make install' rasdaman first to see this file)

   # Change port of Jetty (find 'jetty_port')
   jetty_port=8080 # you could change to 8088 or 9090 or whatever that has not started before ('''NOTE''': no 'space' before and after '=' for example jetty_port =8080 or jetty_port = 8080 and no comment after the end of port like, user could add a new line and comment).

   # Change extracted folder (find 'jetty_extracted_path')
   jetty_extracted_path=   # default is empty because jetty will extracted to default folder '/usr/local/rasdaman/share/rasdaman/war/jetty_tmp', so if you typed your new folder like '/tmp/jetty_tmp', when you start jetty (by start_rasaman.sh or manually) it will extract files to this temporary folder. '''NOTE''': also do not have 'space' or 'comment' like above.
   

Troubleshooting

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

  • A: In most cases, the reason is that the default port is in use by another web service application program. View 3.4 and 3.6 above to figure out and handle this problem.

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

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)