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, runningsource 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
- 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.
- Set Java 1.5 to be the default JRE:
- Set $JAVA_HOME:
export JAVA_HOME=/usr/lib/jvm/default-java
(check that this location works for you) - Extract tomcat, set up
$CATALINA_HOME
:export CATALINA_HOME=/your/install/location
- Start tomcat:
$CATALINA_HOME/bin/startup.sh
- 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. - Install OGSA-DAI.
- Extract to your preferred path
- Set up
$OGSADAI_HOME
- Set up classpath:
source setenv.sh
- Deploy OGSA-DAI servlet:
ant -Dtomcat.dir=$CATALINA_HOME -Ddai.host=192.168.220.131 -Ddai.port=8080 -Ddai.tomcat.version=5 buildDeployWARAndServices
- 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
- You should also check the Axis validation page
http://youraddress:8080/dai/happyaxis.jsp
making sure all the required JAR files are there. Ifactivation.jar
is missing you should just place it in the specified folder. - 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
- We’ll now deploy an SQL Resource using the given properties file:
ant -Dtomcat.dir=$CATALINA_HOME -propertyfile TestMySQL1 deployRelationalResource
- 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. - 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
- 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/
logs/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
).
$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.
ource $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.
- Start tomcat:
$CATALINA_HOME/bin/startup.sh
- Reset classpath:
source $OGSADAI_HOME/setenv.sh