OGSA-DAI Installation OGSA-DAI on OMII 2.0 OMII The Open Middleware Infrastructure Institute NeSC, Edinburgh, 14 September 2005 Amy Krause EPCC a.krause@epcc.ed.ac.uk Outline • Installation of OGSA-DAI WSI 1.0 • Configuration • Use 13 March 2005 http://www.ogsadai.org.uk/ 2 Installation • Download the source or binary OGSA-DAI WSI 1.0 distribution from: http://www.ogsadai.org.uk • Registration is required for the download • Unpack the distribution into a directory of your choice 13 March 2005 http://www.ogsadai.org.uk/ 3 Prerequisites for installation • The following libraries must be present: – jakarta-oro.jar (available from http://jakarta.apache.org/oro) – lucene-final-1.4.jar (available from http://jakarta.apache.org/lucene) – xmldb.jar (available from http://xml.apache.org/xindice) • For each database a driver is required: – JDBC driver for MySQL, e.g. mysql-connector-java-3.0.11-stablebin.jar (available from http://www.mysql.com) 13 March 2005 http://www.ogsadai.org.uk/ 4 Environment • Make sure you’re using Ant version 1.6.1 – – – – Use ‘ant –version’ to display the version number If the version is 1.5.2-20: unzip omii-server-2.0.0/base/apache-ant-1.6.1-bin.zip Add apache-ant-1.6.1/bin to your PATH • Setup the environment: export JAVA_HOME=/home/omiiserv/j2sdk1.4.2_04 export CATALINA_HOME= /home/omiiserv/OMII/jakarta-tomcat-5.0.25 13 March 2005 http://www.ogsadai.org.uk/ 5 Create a binary distribution • If you have downloaded the source distribution you must create a binary package before installation can proceed • Copy the prerequisite libraries into directory ogsadai-wsi-1.0/lib • Compile the source distribution and create the binary package $ ant createBinaryDistribution 13 March 2005 http://www.ogsadai.org.uk/ 6 Deploying OGSA-DAI: Step by Step 1. Deploy OGSA-DAI 2. Deploy a data service 3. Create and deploy a data resource 4. Add the data resource to the service dynamically 13 March 2005 http://www.ogsadai.org.uk/ 7 Deploy OGSA-DAI • Using the GUI installer (recommended): $ ant guiDeployTomcat • Enter a valid Tomcat path when prompted (path of your OMII Tomcat installation) and the web application path (‘axis’) • Or the command line installer: $ ant deployTomcat 13 March 2005 http://www.ogsadai.org.uk/ 8 Restart Tomcat • Restart Tomcat: $ cd <OMII_HOME>/jakarta-tomcat-5.0.25/bin $ ./shutdown_base.sh $ ./start_base.sh 13 March 2005 http://www.ogsadai.org.uk/ 9 Deploy a Data Service • Use the GUI tools: $ ant guiDeployDataServiceTomcat • Enter a local path and name of your Data Service when prompted, e.g. ogsadai/DataService • Tick the box “Configurable?” – this means we can add data resources dynamically without restarting Tomcat 13 March 2005 http://www.ogsadai.org.uk/ 10 Check the deployment • Open a web browser and point it to http://localhost:18080/axis/services • The new data service should show up in the list of services • Run the list-resources client: $ ant listResourcesClient –Ddai.url=http://localhost:18080/ axis/services/ogsadai/DataService • Should return: [java] Service version: OGSA-DAI WSI 1.0 [java] This service exposes no resources! 13 March 2005 http://www.ogsadai.org.uk/ 11 Create a new data resource • Use the GUI tools: $ ant guiCreateResourceTomcat • The wizard will guide you through the setup – Add a MySQL database running on ‘localhost:3306’ and database ‘ogsadai’ – Username is ‘ogsadai’ and password is ‘ogsadai’ – Provide the location of the MySQL JDBC driver – Select a name for your resource, e.g. ‘MySQLResource’ – Save the configuration in a file – Select a Tomcat path and the web application name – Finally, deploy the new resource 13 March 2005 http://www.ogsadai.org.uk/ 12 Data Resource Info • MySQL database • Host ‘localhost:3306’ and database ‘ogsadai’ • Username is ‘ogsadai’ and password is ‘ogsadai’ OR • PostgreSQL database • Host ‘localhost:5432’ and database’omii’ • Username ‘omii_user’ and password ‘omii’ 13 March 2005 http://www.ogsadai.org.uk/ 13 • Add the resource dynamically: $ ant dataServiceClient -Ddai.url=http://localhost:18080/ axis/services/ogsadai/DataService -Ddai.resource.id=MySQLResource -Ddai.action=deploy 13 March 2005 http://www.ogsadai.org.uk/ 16 Check the installation • Run the list-resources client: ant listResourcesClient –Ddai.url=http://localhost:18080/ axis/services/ogsadai/DataService • Should return: [java] Service version: OGSA-DAI WSI 1.0 [java] Number of resources: 1 [java] Resource: MyResource 13 March 2005 http://www.ogsadai.org.uk/ 17 Run a Query • We can now submit a perform document to the service, for example the following simple SQL query SELECT * FROM littleblackbook WHERE id<=100 • Run the end-to-end client: $ ant dataServiceClient -Ddai.url=http://localhost:18080/ axis/services/ogsadai/DataService -Ddai.resource.id=MySQLResource -Ddai.action=examples/GDSPerform/JDBC/ query/select100Rows.xml 13 March 2005 http://www.ogsadai.org.uk/ 18 • Returns: … [java] <currentRow> [java] <columnValue>100</columnValue> [java] <columnValue>Simon Laws</columnValue> [java] <columnValue>824 Anjomshoaa Place, Winchester</columnValue> [java] <columnValue>01349735156</columnValue> [java] </currentRow> [java] </data> [java] </webRowSet>]]></ns2:result> [java] </ns2:response> [java] Request status: COMPLETED 13 March 2005 http://www.ogsadai.org.uk/ 19 Create a Test Database • Add your database driver to the CLASSPATH – (PostgreSQL or other) • Source the setenv.sh script in the OGSA-DAI binary root dir $ source setenv.sh • Populate the test table: java uk.org.ogsadai.client.dbcreate.CreateTestPostgreSQLDB -username omii_user -password omii -database omii 13 March 2005 http://www.ogsadai.org.uk/ 20