Setting up an Alignment Server
An extensive presentation of the Alignment API can be
found
at http://alignapi.gforge.inria.fr
including a description of the Alignment server. We also have
an on-line tutorial on
using it through the server.
Requirements
Using the Alignment server requires an SQL database server.
We see here how to
use mysql or Postgres.
Creating the database for MySQL
In order to use the Alignment server, it is necessary to create its database. This can simply be done by the following shell instructions:
$ sudo /usr/local/mysql/bin/mysqld_safe --user=mysql &
$ /usr/local/mysql/bin/mysqladmin -u root password <mysqlpassword>
$ /usr/local/mysql/bin/mysql -u root -p<mysqlpassword>
sql> CREATE DATABASE AServDB;
sql> GRANT ALL PRIVILEGES ON AServDB.* TO adminAServ@localhost IDENTIFIED BY 'aaa345';
sql> quit
The database schema will be created upon the first launch of the
server.
Creating the database for Postgres
This can be achieved similarly:
$ psql -U postgres
postgres# CREATE DATABASE AServDB;
postgres# CREATE USER adminAServ WITH PASSWORD 'aaa345';
postgres# GRANT ALL PRIVILEGES ON DATABASE AServDB TO adminAServ;
postgres# \q
Or alternatively:
$ su - postgres
postgres@host:~$ createuser -P adminAServ
postgres@host:~$ createdb -O adminAServ AServDB
Enter password, e.g., aaa345, when prompted by createuser command (and answer 'n' to other questions).
Of course, you are advised to use different user, password and
database name. This can be achieved either:
- by changing values of DBMSBASE, DBMSUSER and DBMSPASS in AlignmentServer.java and recompiling;
- by passing parameters dbmsbase, dbmsuser and dbmspass to AlignmentServer.
Launching the Alignment server
The Alignment server requires that the corresponding database management system server be running. In our case, this can be achieved through:
$ sudo /usr/local/mysql/bin/mysqld_safe --user=mysql &
or for more modern distributions:
$ service mysql start
or
$ service postgresql start
Running the Alignment server is achieved through (use the corresponding options):
$ java -jar lib/alignsvc.jar -H
The Alignment server is then available through HTTP with:
http://localhost:8089/html/
The possible switches to the server launcher are:
$ java -jar lib/alignsvc.jar -h
usage: java fr.inrialpes.exmo.align.service.AlignmentService [options]
Launch an Alignment server
Options:
-A,--jade <PORT> Launch JADE service (with port PORT; default 8888)
-b,--dbmsbase <BASE> Use DBMS BASE (default: AServDB)
-B,--dbms <DBMS> Use DBMS system (mysql,postgres; default: mysql)
-D <NAME=VALUE> Use value for given property
-d,--debug <LEVEL> debug argument is deprecated, use logging instead
See http://alignapi.gforge.inria.fr/logging.html
-H,--http <PORT> Launch HTTP service (with port PORT; default 8089)
-h,--help Print this page
-i,--impl <CLASS> Launch service corresponding to CLASS
-l,--dbmsuser <USER> Use DBMS USER (default: scott)
-m,--dbmshost <HOST> Use DBMS HOST (default: localhost)
-o,--output <FILE> Send output to FILE
-O,--oyster Register to Oyster directory
-P,--params <FILE> Read parameters from FILE
-p,--dbmspass <PASS> Use DBMS PASSword (default: tiger)
-s,--dbmsport <PORT> Use DBMS PORT (default: null)
-S,--host <HOSTNAME> Set the HOSTNAME of the server
-u,--uriprefix <URI> Set alignment URIs with prefix URI
-W,--wsdl <PORT> Launch Web service (with port PORT; default 7777)
-X,--jxta <PORT> Launch JXTA service (with port PORT; default 6666)
Alignment server 4.6 (1934M)
See also comments about using the logging mechanisms for detecting errors.
Embedding more methods in the Alignment Server
Adding new matcher, renderer, evaluators, or services in the
Alignment Server, is really easy. This requires that your class be
an implementation of respectively AlignmentProcess, AlignmentRenderer,
Evaluator or AlignmentServiceProfile. It suffices to add all the
necessary jarfiles in the MANIFEST file of the Alignment Server
jarfile used to launch the server (typically alignsvc.jar) and to
put these jarfiles in the same location as this last one.
For instance:
Manifest-Version: 1.0
Created-By: your.MailAddress@example.org
Class-Path: alignsvc.jar olgraph.jar procola.jar
Main-Class: fr.inrialpes.exmo.align.service.AlignmentService
is the required MANIFEST file for embedding our OLA algorithm which
requires two jarfiles: procola.jar and olgraph.jar.
In case of a PermGem error
Because we load all classes in the path to check if they implement an
API interface, this may raise a PermGem error. The only solution is to
increase its size with:
-XX:MaxPermSize=256m
in the command line.
Launching the server with Oyster registery (legacy)
The Alignment API is already compiled with Oyster support. However, it is not ready to be launched. The instructions to do so are:
- get the Oyster2 package from http://ontoware.org/projects/oyster2
- copy the four libraries in lib/ (or at least in the classpath)
- copy the O2serverfiles directory
- copy the "new store" config file
- edit the "new store" config file for it to use the correct environent
- launch kaon2.jar:
$ java -cp lib/kaon2.jar org.semanticweb.kaon2.server.ServerMain -registry -rmi -ontologies O2serverfiles
(use -registryport for using another port than 1099,
then the "new store" configuration file must be edited)
- launch the server:
$ java -jar lib/alignsvc.jar -O -d4
Ports used by the Alignment Server (by default)
The Alignment server is a communicating system that communicates through
TCP sockets which are bound to ports on your machines. We provide here the
list of default ports and options to change them as well as the necessity
for the firewalls to open these ports:
| default | option | open? |
HTTP/REST | 8089 | -H | Y |
MySQL | 3306 | --dbmsport | N (if on the same machine) |
PostGres | 5432 | --dbmsport | N (if on the same machine) |
Jade | 8888 | -A |
// | 1099 | | ? (RMI) |
| 7778 | | Y (MTP HTTP) |
WSDL | 7777 | -W | Y |
JXTA | 6666 | -P | Y |
Oyster | 1099 | -O | Y (RMI/Kaon2) |
Of course, the ports need only to be open if there is an access from
the outside to the server with the corresponding plug-in. The only
compulsory ports for the server is the MySQL one.
Both Jade and Oyster/Kaon2 use rmi connection and the default 1099 port.
Moreover, concerning Oyster, this port must be open to the outside.
Configuring an Apache frontend
It may be convenient to provide access to a server through an Apache
server proxy. For that purpose some tweaking is necessary:
$ a2dissite default
$ a2dissite default-ssl
$ a2enmod proxy
$ a2enmod proxy-http
$ service apache2 restart
Setting up a back-up for the database
Sample backup of the server content (MySQL):
$ /usr/local/mysql/bin/mysqldump -u adminAServ -paaa345 AServDB > AServBackup.sql
And restoring:
$ /usr/local/mysql/bin/mysql -u adminAServ -paaa345 AServDB
sql> source AServBackup.sql;
For Postgres:
$ pg_dump [-W -U adminAServ] AServDB -f AServBackup.sql
And restoring:
$ psql [-W -U adminAServ] < AServBackup.sql
http://alignapi.gforge.inria.fr/aserv.html
$Id$