Wednesday, August 6, 2008

OGSA-DAI 3.0 Installation

This tutorial will take you through the process of deploying OGSA-DAI into the Globus Toolkit container. This tutorial is based on the documentation at www.ogsadai.org with minor changes for local configuration. It is assumed that the GT4 installation tutorial has been understood and completed.

Remember that any non-GSI sessions you use will need to have GLOBUS_LOCATION exported and that switching users via sudo creates a new session. See the GT4 installation for details on changing users and GLOBUS_LOCATION.


To deploy OGSA-DAI GT onto Globus Toolkit container:


Change to the globus user (and remember to change to the home directory with "cd"). The OGSA-DAI binary distribution has already been downloaded and unpacked for you:
cd ogsadai-3.0-gt-4.0.5-bin
Run (after setting GLOBUS_LOCATION):
ant -Dgt.dir=$GLOBUS_LOCATION buildAndDeployGAR
An OGSA-DAI GAR file will be built, copied to Globus Toolkit and then a standard set of OGSA-DAI services will be deployed.

Configuring the server

Relational data resource configuration and deployment in one go

PostgreSQL 8.3 has already been installed for you on your node and a database (in OGSA-DAI terminology a type of resource) called "swissprot" has been deployed for you. Before deploying a resource you need to create a resource file. The name of the resource when deployed will be the same as the name of this file.

To configure and deploy a relational resource do the following:


Write an ANT properties file. This is a file of the form:

dai.resource.id=RESOURCE_ID
dai.db.product=PRODUCT_NAME
dai.db.vendor=VENDOR
dai.db.version=VERSION
dai.db.uri=DATABASE_URI
dai.db.driver=DATABASE_DRIVER_CLASS_NAME
dai.resource.jar.dir=DATABASE_DRIVER_JAR_DIRECTORY
dai.dn=DN
dai.user=DATABASE_USER_NAME
dai.password=DATABASE_PASSWORDWhere each property has values as follows:

dai.resource.id - data resource ID. The ID of the data resource that exposes the relational database. The resource file will have this ID as its name.
dai.db.product - optional argument specifying the database product name.
dai.db.vendor - optional argument specifying the database product vendor.
dai.db.version - optional argument specifying the database product version.
dai.db.uri - database connection URI.
dai.db.driver - database driver class name.
dai.resource.jar.dir - location of directory containing any required database driver JARs and resource implementation JARs. If all the required JARs are already on the server then this value can be omitted.
dai.dn - distinguished name. Optional. If omitted the default of ANY is used. If ANY is provided or used then any DN will map to the username and password for the resource (note that in the actual login configuration files this becomes a *).
dai.user - username compliant with the database.
dai.password - password associated with the above username.
Create a file called "swissprotsql.txt" with the following content:

dai.resource.id=SwissProtSQL
dai.db.product=Postgres
dai.db.vendor=Postgres
dai.db.version=8.2
dai.db.uri=jdbc:postgresql://localhost:5432/swissprot
dai.db.driver=org.postgresql.Driver
dai.user=globus
dai.password=globusRun the deployRelationalResource command. This command:

Creates a relational resource configuration file.
Deploys this resource.
Adds a mapping from a distinguished name to a database user name and password for this resource.

Run:
ant -Dgt.dir=$GLOBUS_LOCATION -Ddai.target.gt=true -propertyfile swissprotsql.txt deployRelationalResource
Restart (as root) your container with the command:
service globus-container restart
Test OGSA-DAI server deployment

You can test your OGSA-DAI server deployment as described in the subsections below.

Ensure Container is Running with OGSA-DAI Services

Firstly check the contents of $GLOBUS_LOCATION/var/container.log to see that the container restarted properly.
Check that the OGSA-DAI services are there by using the command:
grep dai $GLOBUS_LOCATION/var/container.log
You should see output similar to

[42]: https://127.0.1.2:8443/wsrf/services/dai/DataRequestExecutionService
[43]: https://127.0.1.2:8443/wsrf/services/dai/DataResourceInformationService
[44]: https://127.0.1.2:8443/wsrf/services/dai/DataSinkService
[45]: https://127.0.1.2:8443/wsrf/services/dai/DataSourceService
[46]: https://127.0.1.2:8443/wsrf/services/dai/RequestManagementService
[47]: https://127.0.1.2:8443/wsrf/services/dai/SessionManagementService


Example clients
As part of OGSA-DAI a set of example clients are provided . These are intended to allow users to quickly test their deployment as well as providing basic examples of how to construct clients using the client toolkit. To run these tests you will need to connect to your node using gsissh and run all of the test clients from this connection.

Note: The OGSA-DAI example clients are not intended to be the robust end-to-end applications that we would imagine OGSA-DAI end-users using. OGSA-DAI offers a toolkit which provides developers with the tools to develop their own clients that use OGSA-DAI services - these clients are the simplest examples built using this toolkit.

Arguments common to many of the clients are as follows:

Services base URL - this specifies the location of the OGSA-DAI server.
For OGSA-DAI GT the services base URL is of form: https://HOST:PORT/wsrf/services/dai/
where

HOST is the host on which the container is running.
PORT is the port on which the container accepts connections.
A resource type name. This is the name of an OGSA-DAI resource type.
One or more resource IDs. These are just strings possibly with "." delimiters. The following are some examples of resource IDs:
DataRequestExecutionResource
JDBCResource
XMLDBResource
FileResource
uk.org.ogsadai.MyBrandNewDataResource
org.somecompany.com.CustomDataResource
Remember to run these commands as your normal user and connected to your node using gsissh.

Set the CLASSPATH. To set the CLASSPATH use:
source $GLOBUS_LOCATION/etc/globus-devel-env.sh
This will now have included the OGSA-DAI jar files in the CLASSPATH.

Use the secure SQL client. This is a simple command-line client for executing SQL queries on a relational resource and pretty-printing the results. You can specify the ID of the data request execution resource is the OGSA-DAI resource which will execute the request, the ID of the relational data resource at which relational activities in the request (ie. SQLQuery) will be targetted and the SQL query itself. This client is an extension of the SQLClient that allows various Globus Toolkit security settings to be used to secure the communications between the client and the server. It is a useful program to check that server security is configured correctly.
This client is an extension of the SQLClient that allows various Globus Toolkit security settings to be used to secure the communications between the client and the server. It is a useful program to check that server security is configured correctly. Run the command (all one line):

java -DX509_USER_PROXY=$X509_USER_PROXY uk.org.ogsadai.client.toolkit.gt.example.GTSecureSQLClient -u https://127.0.1.2:8443/wsrf/services/dai/ -d SwissProtSQL -q "select * from name where uid<10"
If you get the following (with different IP address) then your OGSA-DAI server is correctly installed.

DRER ID: DataRequestExecutionResource
Data Resource ID: SwissProtSQL
Base Services URL: https://127.0.1.2:8443/wsrf/services/dai/
SQLQuery: select * from name where uid<10
uk.org.ogsadai.resource.request.status.COMPLETED
| uid | name | nametype | seq_id |
| 1 | 14331_ECHGR | entry | 1 |
| 2 | 14-3-3 protein homolog 1 | protein | 1 |
| 3 | Echinococcus granulosus | organism | 1 |
| 4 | 14336_ORYSA | entry | 2 |
| 5 | 14-3-3-like protein GF14-F | protein | 2 |
| 6 | G-box factor 14-3-3 homolog F | protein | 2 |
| 7 | OsGF14a | protein | 2 |
| 8 | 14-3-3-like protein S94 | protein | 2 |
| 9 | Stress-regulated 14-3-3 protein | protein | 2 |



from http://training.omii-europe.org/library/resolve/resolver.jsp?rfr_id=info:sid/nesc.ac.uk:library&rft_title=OGSA-DAI%203.0%20Installation&rft_dat=lib:8973&svc_dat=details&detectflash=false

No comments: