Installation LS 1.1
From GEANT2-JRA1 Wiki
Contents |
Lookup service installation
Requirements
- Java 1.5.x
- Ant 1.6.x
- eXist DB XML - see Exist DB Installation Guide for LS
- JAVA_HOME set
There are two options of installation. First, you may use official release tarball - see #Installation from tarball section. Second option is to download sources from SVN - see #Installation from SVN.
Installation from tarball
Steps of installation
A) Download tarball, e.g.:
wget http://wiki.perfsonar.net/images/files/XML-LS-1.1-RC7.tar.gz
B) Extract files from the archive
tar -xzf XML-LS-1.1-RC7.tar.gz
C) Go to ant directory
cd XML-LS-1.1-RC7/perfsonar/ant/
1) pre-install
- Installer will ask you several questions. You may download tomcat or not. In both cases you must enter tomcat directory (to be created / existing one).
ant -f build-xmlls.xml pre-install
2) build sources
- you don't need to build sources, as they are compiled in
build/directory
3) configure service, answer all the questions
ant -f build-xmlls.xml configure
4) deploy service (will copy axis & service into tomcat)
ant -f build-xmlls.xml deploy
5) test (will display possible tests targets)
ant -f build-xmlls.xml test
5a) the best is to use:
ant -f build-xmlls.xml client-echo
or
ant -f build-xmlls.xml test-echo
- The first accesses service deployed in tomcat (via SOAP client), the second tests service internally
- test-echo (java application) doesn't exit because it runs continuously. Do not bother about it, just press Ctrl+C
- See Possible LS echo request results for possible results and errors
X) stop service
- Assuming that $CATALINA_HOME is your Tomcat directory (check it by:
echo $CATALINA_HOME
- and if it doesn't point to your Tomcat directory, please use the right one:
export CATALINA_HOME=/your/tomcat/directory echo $CATALINA_HOME
- in order to stop the service you must shutdown Tomcat using proprietary script:
cd $CATALINA_HOME/bin sh shutdown.sh
Y) restart service
- in order to start tomcat run:
cd $CATALINA_HOME/bin/ sh startup.sh
- LS should be run together with Tomcat, if not, see point 4) - deploy service
Z) remove LS from Tomcat
- use undeploy script:
ant -f build-xmlls.xml deploy
Installation from SVN
Steps of installation
A) download sources from SVN trunk
svn co https://svn.internet2.edu/svn/perfsonar/trunk/perfsonar
- Lookup Service will be downloaded to "perfsonar" directory
B) go to ant subdirectory
cd perfsonar/ant
C) download all required jars
ant -f build-xmlls.xml libs-xmlls
- It will take some time, because installer must download all required JAR files from the remote server. Be patient :)
1) pre-install
- Installer will ask you several questions. You may download tomcat or not. In both cases you must enter tomcat directory (to be created / existing one).
ant -f build-xmlls.xml pre-install
2) build sources
ant -f build-xmlls.xml build
3) configure service, answer all the questions
ant -f build-xmlls.xml configure
4) deploy service (will copy axis & service into tomcat)
ant -f build-xmlls.xml deploy
5) test (will display possible tests targets)
ant -f build-xmlls.xml test
5a) the best is to use:
ant -f build-xmlls.xml client-echo
or
ant -f build-xmlls.xml test-echo
- The first accesses service deployed in tomcat (via SOAP client), the second tests service internally
- See Possible LS echo request results for possible results and errors
X) stop service
- Assuming that $CATALINA_HOME is your Tomcat directory (check it by:
echo $CATALINA_HOME
- and if it doesn't point to your Tomcat directory, please use the right one:
export CATALINA_HOME=/your/tomcat/directory echo $CATALINA_HOME
- in order to stop the service you must shutdown Tomcat using proprietary script:
cd $CATALINA_HOME/bin sh shutdown.sh
Y) restart service
- in order to start tomcat run:
cd $CATALINA_HOME/bin/ sh startup.sh
- LS should be run together with Tomcat, if not, see point 4) - deploy service
Z) remove LS from Tomcat
- use undeploy script:
ant -f build-xmlls.xml deploy
Description
All targets must be finished by "BUILD SUCCESSFUL". Steps A),B),C) are optional - if you've already got all jars and sources Steps 1),2),3),4) are mandatory. Especially 1) is requires as it creates const.properties file which is used for building and configuration targets.
Example log from installation from tarball (1.1-RC2)
- Environment details
mac@reed:~/perfSONAR-XML-LS-1.1-RC2/perfsonar/ant$ ant -version Apache Ant version 1.6.5 compiled on June 2 2005 mac@reed:~/perfSONAR-XML-LS-1.1-RC2/perfsonar/ant$ java -version java version "1.5.0_02" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09) Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode) mac@reed:~$ pwd /home/mac
- Unpack tarball
mac@reed:~$ ls perfSONAR-XML-LS-1.1-RC2.tar.gz mac@reed:~$ tar -xzf perfSONAR-XML-LS-1.1-RC2.tar.gz mac@reed:~$ cd perfSONAR-XML-LS-1.1-RC2/perfsonar/ant/
- pre-install
mac@reed:~/perfSONAR-XML-LS-1.1-RC2/perfsonar/ant$ ant pre-install
Buildfile: build.xml
Overriding previous definition of reference to classpath
show-info:
[echo] Pre-install
[echo] ---- Welcome in perfSONAR LookupService installation script ----
[echo] You're about to install LookupService that may be also called LS during the installation process. The installation guide is accessible on http://wiki.perfsonar.net/jra1-wiki/index.php/Installation_LS_1.1#Lookup_service_installation web page
[echo] Requirements:
[echo] 1. Java 1.5.x
[echo] 2. Ant 1.6.x (we're sure you've already got it installed as you run the installation process)
[echo] 3. eXist DB XML - see Exist DB Installation Guide for LS:
[echo] http://wiki.perfsonar.net/jra1-wiki/index.php/Exist_DB_Installation_Guide_for_LS
[echo] 4. JAVA_HOME environment variable set to your Java directory
[input] Do you want to proceed? Just press ENTER to continue. Otherwise CTRL-C stops the process immediately
[echo] Preparing the installation of XML Lookup Service...
[echo] Answer to all questions. If you go wrong, cancel (ctrl-c) and start again.
get-inputs:
[input] Do you want to install Tomcat webserver?(y,n)
y
[input] Enter webserver home directory [/usr/local/tomcat_ls]
/home/mac/tomcat
[input] Temporary directory [/home/mac/temp]?
[input] Enter webserver hostname (please type your host and domain name - not localhost)
reed.man.poznan.pl
[input] Enter webserver port [8080]
[input] Enter service directory (where to be installed) [/home/mac/perfSONAR-XML-LS-1.1-RC2/perfsonar]
/home/mac/ls
[input] Enter service deployment name [LookupService]
confirm-inputs:
[echo] ---------------------------------------------------------------
[echo] Your settings:
[echo] ---------------------------------------------------------------
[echo] Tomcat home directory [/home/mac/tomcat]
[echo] Service address [1]
[input] Proceed with these settings? (y,n)
y
get-tomcat:
[echo] Download Tomcat
[mkdir] Created dir: /home/mac/temp
[get] Getting: http://monstera.man.poznan.pl/private/bak/apache-tomcat-5.5.20.tar.gz
[get] To: /home/mac/temp/apache-tomcat-5.5.20.tar.gz
[get] ....................................................
(... dots, dots, and so on ...)
[get] last modified = Thu Sep 28 16:01:58 CEST 2006
[echo] Unpacking Tomcat
[untar] Expanding: /home/mac/temp/apache-tomcat-5.5.20.tar.gz into /home/mac/temp
[delete] Deleting: /home/mac/temp/apache-tomcat-5.5.20.tar.gz
[chmod] Applied chmod to 7 files and 0 directories.
copy-const-properties:
[echo] Create ANT configuration file [/home/mac/perfSONAR-XML-LS-1.1-RC2/perfsonar/ant/const.properties]
[copy] Copying 1 file to /home/mac/perfSONAR-XML-LS-1.1-RC2/perfsonar/ant
pre-install:
BUILD SUCCESSFUL
Total time: 21 seconds
- configure
mac@reed:~/perfSONAR-XML-LS-1.1-RC2/perfsonar/ant$ ant configure
Buildfile: build.xml
Overriding previous definition of reference to classpath
load-const-properties:
configure-ask-for-values:
[echo] ---------------------------------------------------------------
[echo] Enter your settings. Set at least [base path] and [host name],
[echo] other may remain default (default values may be accepted just
[echo] by pressing ENTER)
[echo] ---------------------------------------------------------------
[echo] 1. Service configuration
[echo] ==========================
[input] Enter log configuration file [/home/mac/ls/LookupService/WEB-INF/classes/perfsonar/conf/log4j.properties]
[input] Enter logs directory [/home/mac/ls/LookupService/log]
[input] Enter path for parser configuration file [/home/mac/ls/LookupService/WEB-INF/classes/perfsonar/conf/objects.config]
[echo] 2. Lookup Information configuration
[echo] =====================================
[input] Lookup Information of service -- access point (URL) [2]
[input] Lookup Information of service -- service name [Test Lookup Service]
[input] Lookup Information of service -- service type [LS]
[input] Lookup Information of service -- service description [Test Lookup Service, perfSONAR]
[echo] 3. LS Storage
[echo] =====================================
[input] LS Storage -- XML database type (preferred one is HTTP, because it's much faster)(http,xmlrpc)
http
[input] LS Storage -- XML database collection [3]
[input] LS Storage -- XML database username [lookupservice]
[input] LS Storage -- XML database password [sonar]
[echo] 4. LS Cleanup
[echo] =====================================
[input] LS Cleanup -- enable LS Cleanup (removing old entries when TTL exceeded)?(y,n)
[input] LS Cleanup -- enable LS Cleanup (removing old entries when TTL exceeded)?(y,n)
n
[input] LS Cleanup -- cleanup interval: how often to search old entries in DB [300] (seconds)
[input] LS Cleanup -- TTL of lookup information [3600] (seconds)
configure-show-values:
[echo] ---------------------------------------------------------------
[echo] Your settings:
[echo] ---------------------------------------------------------------
[echo] [ ] Tomcat directory [/home/mac/tomcat]
[echo] [ ] Service address [4]
[echo] [ ] Target path for the application [/home/mac/ls]
[echo] - Properties dir [/home/mac/ls/LookupService/WEB-INF/classes/perfsonar/conf]
[echo] - Log config file [/home/mac/ls/LookupService/WEB-INF/classes/perfsonar/conf/log4j.properties
[echo] - Logs directory [/home/mac/ls/LookupService/log
[echo] - Parser config file [/home/mac/ls/LookupService/WEB-INF/classes/perfsonar/conf/objects.config]
[echo] [ ] Lookup Information
[echo] - LI-access point (URL) [5]
[echo] - LI-service name [Test Lookup Service]
[echo] - LI-service type [LS]
[echo] - LI-service description [Test Lookup Service, perfSONAR]
[echo] [ ] Lookup Storage
[echo] - XML database type [http]
[echo] - XML database collection [6]
[echo] - XML database username [lookupservice]
[echo] - XML database password [sonar]
[echo] [ ] LS Cleanup
[echo] - Cleanup interval [300] seconds
[echo] - Cleanup TTL [3600] seconds
[echo] ---------------------------------------------------------------
configure-confirm-values:
[input] Proceed with these settings? (y,n)
y
copy-components-properties:
[echo] Create COMPONENTS configuration file [/home/mac/perfSONAR-XML-LS-1.1-RC2/perfsonar/conf/components.properties]
[copy] Copying 1 file to /home/mac/perfSONAR-XML-LS-1.1-RC2/perfsonar/conf
copy-service-properties:
[echo] Create SERVICE configuration file [/home/mac/perfSONAR-XML-LS-1.1-RC2/perfsonar/conf/service.properties]
[copy] Copying 1 file to /home/mac/perfSONAR-XML-LS-1.1-RC2/perfsonar/conf
copy-log4j-properties:
[echo] Create log4j configuration file [/home/mac/perfSONAR-XML-LS-1.1-RC2/perfsonar/conf/log4j.properties]
[copy] Copying 1 file to /home/mac/perfSONAR-XML-LS-1.1-RC2/perfsonar/conf
configure:
BUILD SUCCESSFUL
Total time: 24 seconds
- deploy
mac@reed:~/perfSONAR-XML-LS-1.1-RC2/perfsonar/ant$ ant deploy
Buildfile: build.xml
Overriding previous definition of reference to classpath
does-jar-generic-exist:
copy-generic-jar:
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/lib
create-deploy-root:
[mkdir] Created dir: /home/mac/ls/LookupService/wsdd
[mkdir] Created dir: /home/mac/ls/LookupService/WEB-INF/classes
[mkdir] Created dir: /home/mac/ls/LookupService/WEB-INF/classes/perfsonar
[mkdir] Created dir: /home/mac/ls/LookupService/WEB-INF/classes/perfsonar/conf
copy-axis-for-service:
[copy] Copying 1 file to /home/mac/ls/LookupService
[copy] Copying 1 file to /home/mac/ls/LookupService
[copy] Copying 1 file to /home/mac/ls/LookupService
[copy] Copying 1 file to /home/mac/ls/LookupService
[copy] Copying 1 file to /home/mac/ls/LookupService
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/classes
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/classes/perfsonar/conf
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/classes/perfsonar/conf
copy-jars-for-service:
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/lib
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/lib
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/lib
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/lib
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/lib
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/lib
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/lib
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/lib
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/lib
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/lib
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/lib
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/lib
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/lib
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/lib
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/lib
copy-jars-for-xmlls:
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/lib
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/lib
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/lib
[copy] Copying 1 file to /home/mac/ls/LookupService/wsdd
[copy] Copying 1 file to /home/mac/ls/LookupService/wsdd
does-jar-xmlls-exist:
copy-xmlls-jar:
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/lib
copy-other-files:
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/classes/perfsonar/conf
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF/classes/perfsonar/conf
[mkdir] Created dir: /home/mac/ls/LookupService/log
add-context-listener:
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF
[style] Processing /home/mac/ls/LookupService/WEB-INF/web.xml to /home/mac/ls/LookupService/WEB-INF/web.xml.out
[style] Loading stylesheet /home/mac/perfSONAR-XML-LS-1.1-RC2/perfsonar/ant/add-context-listener.xsl
[copy] Copying 1 file to /home/mac/ls/LookupService/WEB-INF
deploy:
[echo] Deploying the service...
Overriding previous definition of reference to classpath
tomcat-start-question:
[input] Do you want me to start the application server Tomcat for you? (y,n)
y
tomcat-start-for-xmlls-true:
[echo] Please, insert now the following xml tag 'Context'
[echo] into Tomcat configuration file server.xml
[echo] (/home/mac/tomcat/conf/server.xml)
[echo] inside existing xml tag 'Host':
[echo] (You may copy XML part (without [echo]):
[echo] <Context path='/LookupService' docBase='/home/mac/ls/LookupService'> </Context>
[echo] Please, do it now. I will wait for you.
[input] Press Return key ...
[echo] Execute: sh /home/mac/tomcat/bin/startup.sh
[echo] Please, make sure that the Tomcat is running. Use the address http://reed.man.poznan.pl:8080 .
[input] Press Return key ...
tomcat-start-for-xmlls-false:
tomcat-start-for-xmlls:
Overriding previous definition of reference to classpath
_deploy-adminclient:
[echo] The directory with all required service files has been created.
[echo] The next step in deploy action is installing the service in Tomcat.
[echo] (If you are an expert in Axis and want to install the service other way
[echo] than default one use ctrl+c to stop the script in this moment)
[input] Press Return key ...
deploy-adminclient:
[java] Processing file /home/mac/ls/LookupService/wsdd/ls-service-deploy.wsdd
[java] <Admin>Done processing</Admin>
BUILD SUCCESSFUL
Total time: 1 minute 29 seconds
- test
mac@reed:~/perfSONAR-XML-LS-1.1-RC2/perfsonar/ant$ ant test
Buildfile: build.xml
Overriding previous definition of reference to classpath
test:
[echo] For testing web service please run:
[echo] ant -f build-xmlls.xml client-register
[echo] ant -f build-xmlls.xml client-query
[echo] ant -f build-xmlls.xml client-keepalive
[echo] ant -f build-xmlls.xml client-deregister
[echo] For testing service without Tomcat (just service functionality) please run:
[echo] ant -f build-xmlls.xml test-register
[echo] ant -f build-xmlls.xml test-query
[echo] ant -f build-xmlls.xml test-keepalive
[echo] ant -f build-xmlls.xml test-deregister
BUILD SUCCESSFUL
Total time: 1 second
- Run test-echo first
mac@reed:~/perfSONAR-XML-LS-1.1-RC3/perfsonar/ant$ ant test-echo
Buildfile: build.xml
Overriding previous definition of reference to classpath
copy-config-files-for-test:
[mkdir] Created dir: /home/mac/perfSONAR-XML-LS-1.1-RC3/perfsonar/build/perfsonar/conf
[copy] Copying 1 file to /home/mac/perfSONAR-XML-LS-1.1-RC3/perfsonar/build/perfsonar/conf
[copy] Copying 1 file to /home/mac/perfSONAR-XML-LS-1.1-RC3/perfsonar/build/perfsonar/conf
[copy] Copying 1 file to /home/mac/perfSONAR-XML-LS-1.1-RC3/perfsonar/build/perfsonar/conf
test-echo:
[java] Test: LS TESTING: [query] in [RequestHandler]
[java] Test: XML File = file:///home/mac/perfSONAR-XML-LS-1.1-RC3/perfsonar/schema/example-instances/perfSONAR/LS/test/EchoRequest.xml
[java] AuxiliaryComponentManager.initManager: Read config file name as: /home/mac/perfSONAR-XML-LS-1.1-RC3/perfsonar/build/perfsonar/conf/components.properties
[java] AUX ComponentManager create [config] = org.perfsonar.commons.auxiliary.components.configuration.properties.PropertiesConfigurationComponent
[java] AUX ComponentManager: init [config]
[java] PropertiesConfigurationComponent.initComponent:Read the file name as: /home/mac/perfSONAR-XML-LS-1.1-RC3/perfsonar/build/perfsonar/conf/service.properties
[java] AUX ComponentManager create [logger] = org.perfsonar.commons.auxiliary.components.logger.log4j.Log4jLoggerComponent
[java] AUX ComponentManager: init [logger]
[java] Output [655b]: <?xml version="1.0" encoding="UTF-8"?>
[java] <nmwg:message id="msg1_resp" messageIdRef="msg1" type="EchoResponse">
[java] <nmwg:metadata id="resultCodeMetadata">
[java] <nmwg:eventType>success.echo</nmwg:eventType>
[java] </nmwg:metadata>
[java] <nmwg:data id="resultDescriptionData_for_resultCodeMetadata" metadataIdRef="resultCodeMetadata">
[java] <nmwgr:datum>LS EchoRequest - This is the successful echo response from the Lookup Service. Additional message is:
[java] Test DB Connection - OK (got database current time: [2007-02-21T15:47:03.285+01:00])
[java] Test DB Schema: [LSStore] - OK
[java] Test DB Schema: [LSStore-control] - OK
[java] </nmwgr:datum>
[java] </nmwg:data>
[java] </nmwg:message>
- run client-server test (connect to server)
mac@reed:~/perfSONAR-XML-LS-1.1-RC3/perfsonar/ant$ ant client-echo
Buildfile: build.xml
Overriding previous definition of reference to classpath
client-echo:
[java] End point: http://reed.man.poznan.pl:8080/LookupService/services/LookupService
[java] Request file: /home/mac/perfSONAR-XML-LS-1.1-RC3/perfsonar/schema/example-instances/perfSONAR/LS/test/EchoRequest.xml
[java] Response file: /home/mac/perfSONAR-XML-LS-1.1-RC3/perfsonar/schema/example-instances/perfSONAR/LS/test/EchoResponse.xml
[java] time taken :0.815 secs
[java] Client exiting
BUILD SUCCESSFUL
Total time: 3 seconds
- see results in /home/mac/perfSONAR-XML-LS-1.1-RC3/perfsonar/schema/example-instances/perfSONAR/LS/test/EchoResponse.xml
mac@reed:~/perfSONAR-XML-LS-1.1-RC3/perfsonar/ant$ cat /home/mac/perfSONAR-XML-LS-1.1-RC3/perfsonar/schema/example-instances/perfSONAR/LS/test/EchoResponse.xml
<?xml version="1.0" encoding="UTF-8"?> <nmwg:message id="msg1_resp" messageIdRef="msg1" type="EchoResponse" xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/"> <nmwg:metadata id="resultCodeMetadata"> <nmwg:eventType>success.echo</nmwg:eventType> </nmwg:metadata> <nmwg:data id="resultDescriptionData_for_resultCodeMetadata" metadataIdRef="resultCodeMetadata"> <nmwgr:datum xmlns:nmwgr="http://ggf.org/ns/nmwg/result/2.0/">LS EchoRequest - This is the successful echo response from the Lookup Service. Additional message is: Test DB Connection - OK (got database current time: [2007-02-21T15:47:15.452+01:00]) Test DB Schema: [LSStore] - OK Test DB Schema: [LSStore-control] - OK </nmwgr:datum> </nmwg:data> </nmwg:message>
- run other tests if necessary
- or just use your LS
