Installation MA

From GEANT2-JRA1 Wiki

Contents

Java version of RRD Measurement Archive (MA)


Software installation

Use theese instructions to download and install the additional software and Measurement Archive code.

Step 1 - Installing Java Development Kit (JDK) 2 Platform

  • We recommend version 1.5 which has been tested. Current code will not compile on version 1.4.
  • In your server choose a directory and download and extract Java 2 Platform from http://java.sun.com/j2se/1.5.0/download.jsp

Step 2 - Installing Apache Ant

Step 3 - Getting sources

You can get sources from CVS (step #3.1) or download a snapshot tar file (step #3.2)

Step 3.1 - SVN

The latest version of MA is available from perfSONAR SVN:

Details how to use SVN can be found | here

Step 3.2 - Snapshot
  • Download a snapshot tar file from download page
  • To download and install Tomcat and Axis enter the following command in $PERFSONAR/ant directory:
ant -f build-rrdma.xml webservice-container-download

Step 4 - Installing RRDTool

  • So far you have got all additional components installed and working. Now it is time to install RRDTool. RRD is the Acronym for Round Robin Database. RRDtool is a system to store and display time-series data. It stores the data and it can create graphs.
  • Follow RRDTool detailed guidelines found here http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/

Step 5 - Download required java libraries

  • In order to download all require libraries (jars) to compile and run the service execute the following command
$PERFSONAR/ant> ant -f build-rrdma.xml libs-rrdma

Warning: If downloading the libraries failed run the script again (the connection might get broken).


Add the path $PERFSONAR/lib to the env variable $CLASSPATH

export CLASSPATH=.:$PERFSONAR/lib

Measurement Archive configuration

Step 6 - Creating RRD metadata configuration file

  • In order of Measurement Archive to work you need to create your own XML file describing measurement data stored in RRD files. This configuration file is used by RRD Measurement Archive to locate data.
  • If this is your first configuration of RRD MA service then you can use test rrd configuration file ($PERFSONAR/conf/rrd-database_TEST.xml) and you don't have to change anything (go to the next step of the Installation Guide).
  • Create and edit your RRD config file following this document ($PERFSONAR/conf/rrd-database....xml). Tailor this file according to your measurement data in RRD files. Examples which help to understand the format of RRD config file are located in $PERFSONAR/conf directory.

Step 7 - Service properties setup

  • Here we are going to set up some properties necessary to run the service. It's better that you call Ant script which will interact with you to do it automaticaly.
  • To generate config files and set up properties run this command:
$PERFSONAR/ant> ant -f build-rrdma.xml configure-rrdma
  • A few times the script will ask you information (NOTE: don't worry about debug messages that Ant generates; these are names of internal structures of the script , eg. 'get-current-path:' or 'get-server-address:'). While asking to change default values (path to RRDtool in this example) the script should return something like:
get-rrdtool-path:
   [input] Set the base path of RRDTool [/usr]:
  • Before creating new configuration files the previous ones get new names, eg. const-old.properties, so a user do not lose them immediately.
  • If you want to edit configuration files manually see service properties files


Measurement Archive compilation

Step 8 - Compilation

  • The next steps compiles perfSONAR sources.
  • In order to compile all sources and create jar file execute the following command
$PERFSONAR/ant> ant -f build-rrdma.xml build-rrdma
  • In order to build rrdjtool libraries execute the following command
$PERFSONAR/ant> ant -f build-rrdma.xml build-rrdjtool
  • After compiling follow the instruction how to setup LD_LIBRARY_PATH)
  • NOTE: If you are working on a Solaris platform run the command ant build-rrdjtool-solaris. If you are working on a Freebsd platform run the command ant build-rrdjtool-freebsd


Starting web applications

Step 9 - Running Tomcat

  • Execute the following command in order to launch Tomcat
$TOMCAT/bin> startup.sh
  • Or restart Tomcat if it has been running previously
$TOMCAT/bin> shutdown.sh
$TOMCAT/bin> startup.sh

Step 10 - Deploying your web service

  • What remains to be done is to deploy the web service in Tomcat. Execute the following command
$PERFSONAR/ant> ant -f build-rrdma.xml deploy-rrdma

Post-installation checks

Step 11 - Validate Jakarta Tomcat installation

  • After installing the web application and dependencies, you should make sure that the server is running the web application.
  • If Tomcat is not running then execute the startup file to run Tomcat:
$TOMCAT/bin> startup.sh
  • Check to see if you get a Tomcat welcome page at http://hostname:port/ The hostname is the DNS entry of the host where tomcat was installed and port is the port on which Tomcat is running.

Step 12 - Validate Axis installation

  • If standard Axis installation procedure was followed then check at http://hostname:port/axis to see if you see an Axis welcome page. Remember that Tomcat should be running.
  • If your are able to get welcome page follow the validation link to see what Axis has to say about the installation. If welcome page is not displayed (but Tomcat has been properly installed and Tomcat welcome page ahs been shown), check in the Tomcat directory to see where Axis was installed.

Step 13 - Testing service installation

'''MeasurementArchiveService'''<br> Hi there, this is an AXIS service!<br> Perhaps there will be a form for invoking the service here...

Testing

Step 14 - Running sample requests

  • It is presumed that you have completed all steps before. Now you can check whether Measurement Archive deployment has been successful.
  • If you have decided to use test rrd configuration file in the service then you don't have to change anything in the Ant target described below. Just run the test client
$PERFSONAR/ant> ant -f build-rrdma.xml run-rrdma-client

Otherwise, follow the next points.

  • First put relevant values in the request file $PERFSONAR/schema/example-instances/sonar/SetupDataRequest-FilterRRDSelect-2.xml. This file (request to get RRD data) will be used by the client application.
  • Then setup at least one argument (the first one) in 'run-rrdma-client' target in $PERFSONAR/ant/rrdma-client-run-targets.xml file. The editable part of file contains following lines:
<target name="run-rrdma-client" 
  description="Runs Java client2">
  <java classname="org.perfsonar.client.testHarness.SOAPClient"
        classpathref="classpath" fork="true">
   <arg value="${ma.local}"/>
   <arg value="${basedir}/schema/example-instances/sonar/SetupDataRequest-FilterRRDSelect-2.xml"/> 
   <arg value="${basedir}/schema/example-instances/sonar/response.xml"/>
  </java>
</target>
  • You may want to edit following arguments:
    • Argument 1 which is the URL of web service e.g. ${ma.local}
    • Argument 2 is the path name of XML file containing the request document e.g. ${basedir}/schema/example-instances/sonar/SetupDataRequest-FilterRRDSelect-2.xml
    • Argument 3 is the path name of XML file which will contain the response from the web service e.g. ${basedir}/schema/example-instances/sonar/response.xml
  • To run your test client request execute the following command
$PERFSONAR/ant> ant -f build-rrdma.xml run-rrdma-client
  • You should get back proper RRD data as a result.
  • If you change something in the code of the web service or update using CVS you have to compile again and redeploy it in Tomcat. Then execute the following commands and restart Tomcat
$PERFSONAR/ant> ant -f build-rrdma.xml undeploy-rrdma
$PERFSONAR/ant> ant -f build-rrdma.xml deploy-rrdma
$TOMCAT/bin> shutdown.sh
$TOMCAT/bin> startup.sh
  • If you change something only in configuration files you have to restart Tomcat
$TOMCAT/bin> shutdown.sh
$TOMCAT/bin> startup.sh

XML database (eXist) as a storage for RRD metadata configuration file

The following steps present how to use xml database (eXist) to store the RRD metadata configuration file

1. Install XML database eXist

  1.1. Download the application from http://exist.sourceforge.net/

  1.2. Install the database

           java -jar eXist-{version}.jar

       It will run GUI installer. Select the path for installation 
       (for example $EXIST_HOME=/usr/local/exist).

  1.3. In order to change eXist database server port, edit $EXIST_HOME/bin/startup.sh
       and change OPTIONS line:


           OPTIONS="-Dexist.home=$EXIST_HOME"

           to

           OPTIONS="-Dexist.home=$EXIST_HOME -Djetty.port=8680"

           (8680 port is only an example)
 
  1.4. Run the database


           $EXIST_HOME/bin> startup.sh
 

  1.5. Run client tool to create a database user (screenshot)


           $EXIST_HOME/bin> client.sh


       Menu of this client: Tools->Edit users  (screenshot)

       Examples of fields required to create a  new user:

           Username: rrdmaservice
           Password: rrdmaservice
           Assigned group: dba


       (Presented password is only an example and should be changed for security reasons!)


2. Configure the RRD MA service

  2.1 Put correct values for the following properties in '$PERFSONAR/conf/service.properties' file:

          component.ma.xmldb.db_status=on

      Info: Indicates whether the service is using xml database (eXist). 
            Acceptable values are 'on' or 'off'.


           component.ma.xmldb.db_access=http

      Info: Type of xml db access (There are two types: http and xmlrpc. In case of the second one
              address of xml database has little different format (see the next property).


          component.ma.xmldb.db_uri=http://localhost:8680/exist/rest/db/rrdmaconfig

      Info: Address of xml database. In the example above port number 8680 is only an example 
            (the real one should be taken; take a look at step #1.3).
             In case of xmlrpc type of xml db access the address format should look like this:
             xmldb:exist://localhost:8680/exist/xmlrpc/db/rrdmaconfig


          component.ma.xmldb.db_uri.xmlrpc=xmldb:exist://localhost:8680/exist/xmlrpc/db/rrdmaconfig

      Info: Address of xml database (xmlrpc access). In the example above port number 8680 is only an example 
            (the real one should be taken; take a look at step #1.3).
             This property is used by Ant script to setup xml db. This script can use only xmlrpc to contact
             with eXist so even if the service uses http type of xml db access (see above component.ma.xmldb.db_access)
             xmlrpc address of xml db is still needed.


          component.ma.xmldb.db_username=rrdmaservice

      Info: The name of a user in xml database. The value above does not need to be changed.
            (see step #1.5)


          component.ma.xmldb.db_password=rrdmaservice

      Info: The password of a user in xml database. The value above is only an example 
            and should be changed for security reasons. (see step #1.5)

3. Init xml database

       in $PERFSONAR/ant directory run:

           ant -f build-rrdma.xml xmldb-init-rrdma


       This command results in sending rrd config file (see 'service.ma.rrd.conf_file' propery 
       in '$PERFSONAR/conf/service.properties' file) to xml database. If such file already exists 
       in xml database then it will be removed but before that the copy will be created 
       in '$PERFSONAR/conf' directory. The name of this copy will get the prefix "dump".


4. Xml database should have only one resource: current rrd configuration file. It's important to remove 
   other resources which could had been used before current configuration. 

   To check how many resources exist in xml database run the following command in $PERFSONAR/ant directory:

          ant -f build-rrdma.xml xmldb-list-rrdma

   (Ant script will print a list of available resources)


   There should be only current rrd configuration file. If there are other resources run the following
   command in $PERFSONAR/ant directory:

          ant -f build-rrdma.xml xmldb-resource-remove-rrdma

   (Ant script will ask for a name of resource to remove)


 5. Restart Tomcat.

          $TOMCAT/bin> shutdown.sh
          $TOMCAT/bin> startup.sh

Registration of RRD MA in LS

The following properties are required in order to register RRD MA in LS.

  • $PERFSONAR/conf/service.properties


       service.r.access_point=http://xxx.yyy.zz:8080/axis/services/MeasurementArchive

   Info: URL of RRD MA service. The above value is only an example and should be changed.


       service.r.service_name=Test MA

   Info: Symbolic name of RRD MA service. The above value is only an example and may be changed.


       service.r.service_type=MA

   Info: Service type. The above value should not be changed.


       service.r.service_description=Test MA, perfSONAR project

   Info: Description of service. The above value is only an example and may be changed.


       service.r.ls_url=http://aaa.bbb.cc:8080/axis/services/LookupService

   Info: URL of LS service which will accept registration requests.
         The above value is only an example and should be changed.


       component.registrator.interval=30000

   Info: Interval time (milliseconds) between registration messages.
         The above value could be used in real life configuration.


       component.registrator.scheduler_component=ma_scheduler

   Info: The name of a scheduler used for registration. The above value should not be changed.


  • $PERFSONAR/conf/components.properties
       ma_scheduler=org.perfsonar.commons.auxiliary.components.simplescheduler.Scheduler
       registrator=org.perfsonar.service.measurementArchive.register.LSRegistrationComponent

Fuctionality of storing measurement data in RRD MA

The following steps present how to switch on the functionality of storing measurement data in RRD MA

1. Configure xml database for rrd configuration file
   (see section above 'XML database (eXist) as a storage for rrd configuration file')

2. Configure the RRD MA service

  2.1 Put correct values for the following properties in '$PERFSONAR/conf/service.properties' file:


          service.ma.xmldb.db_store=on

      Info: Indicates whether the the service should have the functionality of storing measurement data 
            in RRD MA switched on. Acceptable values are 'on' or 'off'.


          service.ma.rrd.xmldb.db_store.data_dir=/opt/sonar/perfsonar/

      Info: The directory where new rrd files with measearement data sent to MA will be located.


3. Restart Tomcat.
 
          $TOMCAT/bin> shutdown.sh
          $TOMCAT/bin> startup.sh


Testing

In order to test anabled functionality you can use two example requests stored 
in '$PERFSONAR/schema/example-instances/sonar/' directory:
- MeasurementArchiveStoreRequest-1.xml
- MeasurementArchiveStoreRequest-Key-1.xml
Remember to put correct values in these files!

The following commands (executed in '$PERFSONAR/ant' directory) run simple soap client application 
to send mentioned requests to RRD MA service:

 
    sending MeasurementArchiveStoreRequest-1.xml:

        ant -f build-rrdma.xml run-rrdma-client-store


    sending MeasurementArchiveStoreRequest-Key-1.xml

        ant -f build-rrdma.xml run-client-store-with-key


Remember to put correct address of RRD MA in the ant targets (run-client-store, run-client-store-with-key) 
in '$PERFSONAR/ant/client-run-targets.xml' file.


    (take a look at the first argument inside 'java' element):


      <target name="run-rrdma-client-store" description="Runs Java client">
          <java classname="org.perfsonar.client.testHarness.SOAPClient"
                classpathref="classpath" 
                fork="true">
              <arg value="http://xxxx.yyy:8080/axis/services/MeasurementArchiveService"/>
              <arg value="${basedir}/schema/example-instances/sonar/MeasurementArchiveStoreRequest-1.xml"/>
              <arg value="${basedir}/schema/example-instances/sonar/response.xml"/>
          </java>
      </target>


      <target name="run-rrdma-client-store-with-key" description="Runs Java client">
          <java classname="org.perfsonar.client.testHarness.SOAPClient"
                classpathref="classpath" 
                fork="true">
              <arg value="http://xxxx.yyy:8080/axis/services/MeasurementArchiveService"/>
              <arg value="${basedir}/schema/example-instances/sonar/MeasurementArchiveStoreRequest-Key-1.xml"/>
              <arg value="${basedir}/schema/example-instances/sonar/response.xml"/>
          </java>
      </target>


Ping the service

The request Echo-Req.xml can be used to monitor the availability of service.

$PERFSONAR/ant> ant -f build-sqlma.xml run-echo

Response file: $PERFSONAR/schema/example-instances/sonar/Echo-Resp.xml


Python version of Measurement Archive

Personal tools