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:
$CATALINA_HOME/logs
(there shouldn’t really be any problem here though)$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:
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
sudo apt-get install sun-java5-jdk
sudo update-java-alternatives -s java-1.5.0-sun
java –version
to make sure the correct version is being used.export JAVA_HOME=/usr/lib/jvm/default-java
(check that this location works for you)$CATALINA_HOME
: export CATALINA_HOME=/your/install/location
$CATALINA_HOME/bin/startup.sh
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
).
/etc/bash.bashrc
so that they are available for all profiles or to ~/.profile
so it is remembered for your user account.$OGSADAI_HOME
source setenv.sh
ant -Dtomcat.dir=$CATALINA_HOME -Ddai.host=192.168.220.131 -Ddai.port=8080 -Ddai.tomcat.version=5 buildDeployWARAndServices
$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
remote administrator access is not allowed
. This is the result of a missing configuration file called
server-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.
http://youraddress:8080/dai/services
http://youraddress:8080/dai/happyaxis.jsp
making sure all the required JAR files are there. If activation.jar
is missing you should just place it in the specified folder.
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
ant -Dtomcat.dir=$CATALINA_HOME -propertyfile TestMySQL1 deployRelationalResource
$CATALINA_HOME/webapps/dai/WEB-INF/etc/dai/resources/
- if not copy it there from wherever it was created.ant -Dtomcat.dir=$CATALINA_HOME -Ddai.resource.id=TestMySQL1 -Ddai.user=username-Ddai.password=password permit
java uk.org.ogsadai.client.toolkit.example.SQLClient -d TestMySQL1 -q "SELECT * FROM TableName" -u http://hostaddress:8080/dai/services/
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.
$CATALINA_HOME/bin/startup.sh
source $OGSADAI_HOME/setenv.sh