Changes between Version 9 and Version 10 of PetascopeEmbedded


Ignore:
Timestamp:
Dec 18, 2015 5:26:45 PM (22 months ago)
Author:
bphamhuu
Comment:

Update about how to use jetty correctly

Legend:

Unmodified
Added
Removed
Modified
  • PetascopeEmbedded

    v9 v10  
    55== How to Use ==
    66
    7 '''Purpose:''' Run petascope "out of the box", without any further installation and configuration of a servlet container like tomcat.
    8 Jetty is a Web server and javax.servlet container which can be bundled with an application.
    9 To this end, petascope can be deployed with the jetty container bundled, '''alternatively''' to utilizing a standard servlet container like tomcat.
     7'''Purpose:''' Run petascope, secore without any further installation and configuration of a servlet container like tomcat.
     8jetty is a Web server and javax.servlet container which can be bundled with an application.
     9To this end, petascope, secore can be deployed with the jetty container bundled, '''alternatively''' to utilizing a standard servlet container like tomcat.
    1010
    11 '''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`.
     11'''Start:''' Following successful installation of rasdaman with jetty enabled,
     12
     13{{{
     14./configure --with-java-server=embedded        [and some configurations that you want to install, like --prefix=$RMANHOME]
     15}}}
     16
     17the petascope Web service gets automatically started by the general rasdaman launch script `start_rasdaman.sh`.
    1218
    1319'''Service URLs:''' After successful start, petascope accepts requests according to OGC W*S standards at `http://localhost:8080/rasdaman/ows`.
    1420Further, the SECORE Coordinate Reference System Resolver (CRS) service is available at `http://localhost:8080/def`.
    1521
    16 ''' 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.
     22''' Stop:''' The petascope/jetty service gets stopped by `stop_rasdaman.sh`  '''if''' it has been started through `start_rasdaman.sh`. When started independently before executing `start_rasdaman.sh`, an error will notice that '''jetty is running and need to kill manually'''.
     23
    1724
    1825== How to Change the Port ==
     
    2330jetty_port=8080
    2431}}}
    25 Change this to the desired port, save the file, and restart jetty.
     32Change this to the desired port, save the file, and run stop_rasdaman.sh and start_rasdaman.sh to make it work with new port.
    2633
    2734== How to Change the Extraction Folder ==
     
    3744jetty_extracted_path=/tmp/petascope-jetty'
    3845}}}
    39 and restart petascope.
     46and run stop_rasdaman.sh and start_rasdaman.sh to make it work with new extracted directory.
     47
     48'''NOTE:'''You should let the extracted directory by default in $RMANHOME/share/rasdaman/war/jetty_tmp as move to /tmp which can be deleted without warning from system.
     49
     50== Manually configure to start/stop jetty ===
     51
     521. If you do not want to start it with start_rasdaman.sh temporary, you can add this argument to stop using jetty ''for only this session.''
     53
     54{{{
     55start_rasdaman.sh --stop-embedded-petascope
     56}}}
     57
     582. If you do not want to start it with start_rasdaman.sh permanently, you have to change in $RMANHOME/etc/petascope.properties
     59{{{
     60start_embedded_petascope=false
     61}}}
     62
     633. If you already disable start jetty when run start_rasdaman.sh in $RMANHOME/etc/petascope.properties by setting
     64{{{
     65start_embedded_petascope=false
     66}}}
     67
     68You can still run jetty in only this session with
     69{{{
     70start_rasdaman.sh --start-embedded-petascope
     71}}}
     72
     73'''NOTE:''' If java_server was set to ''external'' then all these configurations do not work.
    4074
    4175== Troubleshooting ==   
     
    4377Q: Cannot start petascope/jetty to listen for Web requests.
    4478* A: Most likely, the petascope port is in use by another web service application program. See above for changing the petascope port. Also, make sure that petascope is not running simultaneously in tomcat.
     79
     80Q: In some case, jetty has started before start_rasdaman.sh
     81* A: You have to terminate this jetty or when you run start_rasdaman.sh, an error will notice old jetty is running (it does not work) and it will not start working jetty.
     82
     83{{{
     84# Check if jetty is running
     85ps -ef | grep 'jetty'
     86rasdaman   407     1  0 Dec17 ?        00:01:39 java -cp /home/rasdaman/install//share/rasdaman/war/jetty.jar:/home/rasdaman/install//share/rasdaman/war/ start_petascope /home/rasdaman/install/
     87rasdaman 26955  4148  0 16:58 pts/1    00:00:00 grep --color=auto jetty
     88
     89# It is old jetty and need to kill
     90kill -9 407
     91}}}
     92
    4593
    4694Q: My port number and/or extraction directory settings are not recognized, petascope still uses the defaults.
     
    58106== For Developers ==
    59107
    60 In the download directory, jetty is located in rasdaman folder `$RMANHOME/applications/petascope/jetty`.
     108In the download directory, jetty is located in rasdaman folder `/applications/petascope/jetty`.
    61109This folder contains:
    62 * README.txt # help file for building petascope manually (NB: you need to copy file `rasdaman.war` (see below) to this directory to run it).
    63 * def.war # CRS (Coordinate Reference System) service
    64 * jetty.jar # jetty servlet container
     110* jetty.jar # jetty servlet container, this is made based on Jetty 7 embedded to support JSP (default Jetty 7 does not support). Using this version to allow to run with Java 1.6.
    65111* start_petascope.class # compiled Java code for starting jetty with petascope
    66112* start_petascope.java # corresponding Java source code
    67113
    68 The `./configure` and `make install` process produces `$RMANHOME/share/rasdaman/war/rasdaman.war`.
    69 
    70 Rebuilding petascope manually can be done as follows (after having run './configure' in `$RMANHOME`):
    71 {{{
    72 #!sh
    73 cd $RMANHOME/applications/petascope/
    74 make         # creates $RMANHOME/applications/petascope/build/dist/rasdaman.war
    75 make install # copies jetty files to $RMANHOME/applications/petascope/jetty
    76 }}}
     114`make install` inside `/applications/petascope' will copy all these files to $RMANHOME/share/rasdaman/war/