ToS Installation
From GEANT2-JRA1 Wiki
The Topology Service is a Java Web Service that requires the following components:
* JAVA 2 development and runtime environment (JDK and JRE), the former includes the runtime. * PostgreSQL 8 and JDBC driver * Apache Tomcat, Apache Ant & Axis
Currently, the development is being done in Debian 3.1 (Sarge) and MacOS X but any platform that can run Java 2 and PostgreSQL should work too.
Step PreInstall.1 - Java Development Kit (JDK) 2 Platform
For a successful install we recommend JDK version 1.5, which has been tested. Download and extract Java 2 Platform Standard Edition from http://java.sun.com/j2se/1.5.0/download.jsp.
Step PreInstall.2 - Apache Ant
Apache Ant is a Java-based build tool compulsory to proceed with other steps that are using Ant scripts. Download Ant (ver. 1.6.x) from http://ant.apache.org/bindownload.cgi and install it.
Step PreInstall.3 - PostgreSQL
This is very platform specific, go to http://www.postgresql.org/ and check availability and installation instruction for your platform.
Some OS vendors provide themselves, packages ready to be installed, in the case of Debian 3.1 (Sarge) you can check the backports repository (http://www.backports.org).
It might be interesting to install also a graphical UI to browse the database, there are many of them (eg: phppgadmin).
The JDBC driver for PostgreSQL will be installed with the ToS installation scripts.
The database is usually installed in the same service as the ToS but it might be in a remote machine too.
Step PreInstall.4 - Database load
Create the user that will load the database and will be used by the ToS in order to access the database.
Currently the database load is done with SQL scripts done by the CNM-Team (DFN) please contact them at mailto:cnm-team@lrz-muenchen.de in order to populate the database.
Step Install.1 - Create a base directory for the installation of ToS and its components
Create a directory where the ToS will reside and change the work directory to it.
Step Install.2 - Download the source
Download the source by using SubVersion (svn) utility. Currently it is suggested to install the ToS from a branch, by the use of the following command:
svn co https://svn.perfsonar.net/svn/perfsonar/branches/ulisseskan
This will create a ulisseskan/ subdirectory under the base directory.
Change to the ulisseskan/ant subdirectory and do not leave it in the rest of the installation.
Step Install.3 - Obtain required information and configure configure the service
- LS
- URL: This is the URL of a Lookup Service server that will be used to register the ToS, in order the ToS can be located by clients. Check the perfSonar web or ask in the perfsonar-user mailing list for a server to use.
- LS registration interval (default is ok)
- Description of the ToS service as to be published in the LS.
- JDBC configuration for accesing the PostgreSQL to access the database from the ToS. Making the assumption that the PostgreSQL has been installed locally, the configuration will be:
- jdbc uri: jdbc:postgresql:<user specified in step 4>
- jdbc user: <user speciried in step 4>
- jdbc pass: <password specified in step 4>
- Tomcat defaults are ok
- Tomcat address
- Tomcat port
- Tomcat destination directory (it will be really installed in other steps)
With this information, configure the service by executing:
ant -f build-tops.xml configure
Step Install.4 - Addional questions and download of Tomcat
When executing the following command it will be asked where to install the ToS, also answer yes when you are prompted to download Tomcat and specify the same location for Tomcat installation as in step Install.3.
ant -f build-tops.xml pre-install
Step Install.5 - Download perfSonar precompiled libraries and JDBC driver for postgreSQL
ant -f build-tops.xml libs-tops
Step Install.6 - Build the topology service
ant -f build-tops.xml build
Step Install.7 - Install Tomcat, Axis & Deploy the service
The Tomcat & Axis is easily installed, by executing the following target:
ant -f build-tops.xml deploy
the components will be installed and the service will be deployed (a term used in Web services to mean that the service is ready to be executed).
Bear in mind that some manual configuration will be need, answer yes to the following question:
tomcat-start-question:
[input] Do you want me to start the application server Tomcat for you? (y,n)
and when the following text is shown edit manually the specied file (it is the Tomcat configuration file).
tomcat-start-for-tops-true:
[echo] Please, insert now the following xml tag Context
[echo] into Tomcat configuration file server.xml
[echo] (/home/ulisses/tmp/demo/tomcat/conf/server.xml)
[echo] inside existing xml tag Host:
[echo] <Context path='/perfSONAR-ToS'
[echo] docBase='/home/ulisses/tmp/demo/webapps/perfSONAR-ToS'>
[echo] </Context>
[echo] Please, do it now. I will wait for you.
[input] Press Return key ...
[echo] Please, make sure that the Tomcat is running. Use the address http://localhost:8080 .
[input] Press Return key ...
Step Check.1 -- Download the database
To check the installation we will perform a full database download by issuing the following command:
ant -f build-tops.xml run-tops-client
Step Check.2 -- Verify the result
Check the output and don't trust the BUILD SUCCESSFUL message. If something looks wrong:
Check the URL mentioned in the message in a browser:
End point: http://localhost:8080/perfSONAR-ToS/services/TopologyService
This is the URL of the topology service, if something is wrong use that URL in a browser to check if the ToS service is running.
Check the output of the service specified in the URI (and its timestamp), eg:
Response file: /home/ulisses/tmp/tmp2/ulisseskan/schema/example-instances/perfSONAR/TOPS/test/TOPSDownloadResponse.xml
That file will show the result of the ToS, that is the Topology information dumped. Open that file with you favourite text or xml editor and see it's contents.
If there are no contents or there is an error message please re-check that the WebService (and threfore the Tomcat server) is running, a simple way to check it is to check the End point URL with a web browser. To provide addional information, check also the following log files:
Tomcat: <installation directory>/logs ToS : <installation directory>/log
