现在的位置: 首页 > 综合 > 正文

Installing OGSA-DAI 3.1 (A Rough Guide)

2013年10月14日 ⁄ 综合 ⁄ 共 6478字 ⁄ 字号 评论关闭

 

For the past few weeks I’ve been looking at various open source database systems, looking for components that may be useful in my research. One of those systems was OGSA-DAI, a grid integration framework. The software itself looks good, but I endured a fairly painful installation process which I thought I’d share in-case you find yourself in a similar position.

This post starts with some pointers on diagnosing errors, then moves on to a step-by-step guide detailing the setup process which worked for me.

The official installation guide is good (I’d start there), but when you encounter unexpected behavior it can be difficult to find the root cause – something which the following sections should help you with.

FINDING ERRORS
Generally speaking, there are three places where errors may occur:

  • In your Tomcat distribution: in which case I’d check the log files in $CATALINA_HOME/logs(there shouldn’t really be any problem here though)
  • In your DAI servlet: a result of missing or incorrect config files (the next section details how to turn on logging for DAI – very useful for these errors).
  • In $OGSADAI_HOME, the binary folder: probably a classpath issue. In general, running source setenv.sh from this folder fixes this, but make sure all the other environment variables are set.

ENABLING LOGGING
If your DAI servlet isn’t working as expected I’d first enable DEBUG logging. This can be done by creating (or editing) the following file: $CATALINA_HOME/webapps/dai/WEB-INF/classes/log4j.properties

Overwrite the existing contents with:

# Categories
log4j.rootLogger=DEBUG, ROLLINGFILE
log4j.category.org.apache=INFO, ROLLINGFILE log4j.category.org.globus=INFO, ROLLINGFILE
# ROLLINGFILE appender
log4j.appender.ROLLINGFILE=org.apache.log4j.RollingFileAppender
log4j.appender.ROLLINGFILE.Threshold=DEBUG
log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.ROLLINGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n log4j.appender.ROLLINGFILE.File=/logfilelocation/ogsa.log

The location of the log file to be created is specified on the last line, with the remaining syntax explained here.

INSTALLATION
REQUIRED FILES
The remainder of this post discusses the process of installing OGSA-DAI 3.1 (with Axis 1.4) onto a clean Ubuntu Server 8.10 distribution. The following files will be necessary for installation:

  • OGSA-DAI binary
  • Apache Tomcat (I used 5.0, but it should work with 5.5)
  • Activation.jar (required by Axis)
  • MySQL 5 (Installed this using sudo apt-get install mysql-server-5.0 – if you’re not on a debian-based distribution you’d have to use something else)

STEP-BY-STEP INSTRUCTIONS

  1. Install Java 1.5 (OGSA-DAI doesn’t work with 1.6) with command sudo apt-get install sun-java5-jdk

    • Set Java 1.5 to be the default JRE: sudo update-java-alternatives -s java-1.5.0-sun
    • Run java –version to make sure the correct version is being used.
  2. Set $JAVA_HOME: export JAVA_HOME=/usr/lib/jvm/default-java (check that this location works for you)
  3. Extract tomcat, set up $CATALINA_HOMEexport CATALINA_HOME=/your/install/location
  4. Start tomcat: $CATALINA_HOME/bin/startup.sh
  5.  

    Tomcat may refuse to start at this point if it is unable to write tologs/catalina.out. This is generally a rights issue – you can either chown the necessary files so that it is run as your user or, if you installed it with a package manager, use the given startup script (possibly at/etc/init.d/tomcat5).

     

  6. Add the previous export commands to /etc/bash.bashrc so that they are available for all profiles or to ~/.profile so it is remembered for your user account.
  7. Install OGSA-DAI.
    • Extract to your preferred path
    • Set up $OGSADAI_HOME
    • Set up classpath: source setenv.sh
  8. Deploy OGSA-DAI servlet: ant -Dtomcat.dir=$CATALINA_HOME -Ddai.host=192.168.220.131 -Ddai.port=8080 -Ddai.tomcat.version=5 buildDeployWARAndServices
  9.  

    This command failed for me in three ways. (1) The process doesn’t have permission to copy files to the $CATALINA_HOME/webapps directory. This can be fixed by running it as the super-user, but I’d recommend just giving your user write access to the given folder. (2) The script looks for a tomcat configuration file that ends in 5.0, rather than 5 – if you go to the folder where this is expected you just need to rename the file to add the ‘.0’ Doing this in the ant parameters didn’t seem to work for me. (3) Finally, you may get an axis error along the lines of: faultString: (404)/dai/services/AdminService
    There will also be an error encoded in HTML saying that remote administrator access is not allowed. This is the result of a missing configuration file calledserver-config.wsdd. I found that this file was created in some cases when I installed OGSA, but not in others. To fix this download server-config.wsddand place it into the folder $CATALINA_HOME/webapps/dai/WEB-INF/. Or if one is already there then you can just add the following code:
    <service name="AdminService" provider="java:MSG">
    <parameter name="className" value="org.apache.axis.util.Admin"/>
    <parameter name="allowedMethods" value="*"/>
    <parameter name="enableRemoteAdmin" value="true"/>
    </service>

     

    There are some security implications of allowing remote admin that I’ll assume you can handle yourself.

     

  10. Check that all the OGSA web services are deployed correctly. There should be more than two (the standard axis ones) on the following webpage: http://youraddress:8080/dai/services
  11. You should also check the Axis validation page http://youraddress:8080/dai/happyaxis.jspmaking sure all the required JAR files are there. If activation.jar is missing you should just place it in the specified folder.
  12.  

    The remainder of these instructions are concerned with deploying some sample resources to test things out – feel free to ignore these if you have everything you need working.

     

  13. Before deploying an SQL resource we must first generate a resource file, changing the parameters to suit your system: ant -Ddai.db.product=MySQL -Ddai.db.vendor=MySQL -Ddai.db.version=5 -Ddai.db.uri=jdbc:mysql://localhost:3306/ogsadai -Ddai.db.driver=org.gjt.mm.mysql.Driver -Ddai.resource.id=TestMySQL1 createRelationalConfig
  14. We’ll now deploy an SQL Resource using the given properties file: ant -Dtomcat.dir=$CATALINA_HOME -propertyfile TestMySQL1 deployRelationalResource
  15. Make sure that this properties file is now located in $CATALINA_HOME/webapps/dai/WEB-INF/etc/dai/resources/- if not copy it there from wherever it was created.
  16. You must now specify the password for your database resource: ant -Dtomcat.dir=$CATALINA_HOME -Ddai.resource.id=TestMySQL1 -Ddai.user=username-Ddai.password=password permit
  17. You should now be able to query the resource and run from the $OGSADAI_HOME folder:  java uk.org.ogsadai.client.toolkit.example.SQLClient -d TestMySQL1 -q "SELECT * FROM TableName" -u http://hostaddress:8080/dai/services/

 

If a ClassNotFoundException is thrown on the last command this indicates an incorrectly set classpath. The first thing I’d do here is re-run source $OGSADAI_HOME/setenv.sh

 

RESTARTING THE SYSTEM

If you’ve restarted your machine you’ll need to restart Tomcat (assuming it isn’t running as a service – see: http://www.computing.net/answers/linux/how-to-autostart-tomcat-initdrcd/29307.html) and reset the classpath. If you didn’t set your bash profile to remember $JAVA_HOME, etc, then you’ll have to reset those as well.

  1. Start tomcat: $CATALINA_HOME/bin/startup.sh
  2. Reset classpath: source $OGSADAI_HOME/setenv.sh

 

抱歉!评论已关闭.