header

Installation

The server and the clients (C++, Java and Python) are provided as RPMs packages. RPMs are currently only supported for CERN Scientific Linux or RedHat Enterprise Linux. For users running other operating systems (including Windows and other unix flavours), the Java client is also provided as a platform-independent package (a tar ball), including the Java API, a command line client, some examples and the documentation. You can find the packages in the download directory. Download the latest version. As of writing this it is 2.3.0

You can install the emi.amga.amga-cli and the python and java api packages independently of the server package, however the server packages depend on the client package.

Client installation

To install the command line client and C++ api, you will only need to download the emi.amga.amga-cli rpm itself. By default the package will be installed into /usr, so you will need to have write permission for this directory. Install the package via

    $ rpm -i emi.amga.amga-cli-${version}.${platform}.rpm
  or 
    $ sudo yum install emi.amga.amga-cli

Copy the /etc/mdclient.config client configuration file into the directory from which you intend to work or into ~/.mdclient.config and customize it according to the instructions in Configuration of the C++ and Java command line clients.

If the amga client was built against the editline library instead of the standard unix readline library, you will need to also install that RPM.

To install the RPM with Java API, install the file named glite-amga-api-java-0.X.Y.rpm. This RPM is architecture-independent and will install in any Unix platform that supports RPM packages. This RPM contains only the Java API (no command line client or documentation). It installs the file glite-amga-api-java.jar in /opt/glite/share/java/. To use the Java API, this file must be included on the classpath.

The tar ball with the Java Client API does not need any special installation procedure, apart from unpacking it. It provides both the documentation, the Java API, and two command line utilities similar to the ones installed by the C++ RPM, with the advantage of running in any platform with a Java virtual machine implementation (must be at least Java 1.4 compliant). These command line tools are:

The tar ball includes two scripts to start these command line tools:

There is also a Python Client API module available as an RPM package, which will install the modules under /opt/glite/python2.2/site-packages/amga.

Alternatively you can use the Python2.3 RPM which works nicely on Debian Sarge. If you prefer a custom installation you can download the source tarball glite.amga.api-python-1.1.0.tar.gz and install it via the Python installation mechanism (if you don't know how this works, ./setup.py --help should get you started.

Server installation

The AMGA server depends on some external dependencies which are provided by the EMI team for yum based installation.

The following packages are necessary to use AMGA and must be installed first: These are standard SL packages and can be also found in the ususal EMI repositories.

    - boost
    - editline
    - gdbm
    - libxml2
    - openssl
    - unixodbc
    - libuuid(SL6 only,SL5 is OS Default)

If AMGA was compiled against the Globus environment and not the SL environment in order to use the Globus versions of several SL system libraries like openssl, then you will also need to install the Globus RPM. The EMI project currently only provides versions of AMGA which does not depend on Globus.

Now install the server RPMs for AMGA (the server needs the client):

  $ wget
http://amga.web.cern.ch/amga/downloads/${version}/${platform}/emi.amga.amga-server-${version}.${platform}.rpm 
  $ rpm -i emi.amga.amga-server-${version}.${platform}.rpm
or 
  $ sudo yum install emi.amga.amga-server

You also need a database and the appropriate ODBC driver. AMGA currently supports 4 different database backends via ODBC drivers. You will need to get at least one of the currently supported 4 database backends installed, including their ODBC driver. You have the choice among PostgreSQL, MySQL, Oracle and SQLite. The default is PostgreSQL and this database should be set-up correctly when installing the AMGA RPM if you have PostgreSQL and its ODBC driver installed:

  $ sudo yum install postgresql-server postgresql

If you want to use a different database or you want to have a different setup of the ODBC driver, have a look at the more detailed instruction in the Installation from Source .

Note: For AMGA to work properly, you need at least version 08.01.0200 of the PostgreSQL ODBC driver. On the defalut SL, the driver is too old, so that it is necessary to install the lastest driver as follows.

  $ sudo yum install postgresql-odbc

You will need to get at least one of these 4 database backends in order to use the service. ODBC should have been installed correctly by the AMGA rpm, if you want to use a standalone installation using PostgreSQL. If you don't know about ODBC, some more hints can be found in the Installation from Source or on a general page on the Unix ODBC User Manual.

For the configuration, you first have to create a DB user, make sure he can connect via a TCP/IP connection (even locally this is required since ODBC does not work via a Unix Domain socket) and then set up an ODBC data source. This can be done with the single script as follows.

  $ su root
  
  $ /etc/rc.d/init.d/mdservice init

The steps in manual are:

  $ su root
  
  $ service postgresql initdb (If you are using postgreSQL 8.4 or higher)
  
  $ /etc/init.d/postgresql start
  $ /etc/init.d/postgresql stop

  $ cat /var/lib/pgsql/data/pg_hba.conf
  # ....
  local   metadata    arda      trust
  host    metadata    arda      127.0.0.1/24    trust
  host    metadata    arda      ::1/128         trust


  $ /etc/init.d/postgresql start
  $ su postgres
  $ createuser -S -d arda       # Create DB user arda, allow him new DBs
  $ createdb -O arda metadata   # New DB metadata owner is arda
  $ createlang plpgsql metadata # Allow stored procedures

The ODBC data source is created by appending the following lines to /etc/odbc.ini:

  [PSQL]
  Description     = AMGA metadata catalogue database
  Driver          = PostgreSQL_AMGA
  Trace           = No
  TraceFile       = /tmp/metadata/odbc.log
  Database        = metadata
  Servername      = localhost
  Port            = 5432
  ReadOnly        = No
  Address         = localhost:5432
  User            = arda

The Driver needs to name a valid driver description in the /etc/odbcinst.ini file:

  [PostgreSQL_AMGA]
  Description     = ODBC for AMGA PostgreSQL
  FileUsage       = 1
  CPTimeout       = 120
  CPReuse         =
  Debug           = 0
  Threading       = 1
  CommLog         = 0
  DontDLClose     = 1
  Driver          = /usr/lib/psqlodbc.so

This setup should be done automatically correctly when installing the unixODBC or postgresql-odbc RPMs on other distributions. If you want to check your ODBC installation, you can use the DataManagerII application which can be found in the unixODBC-kde package on SLC.

Now you can initialize the database using the createInitialXXX.sql scripts, where XXX has to be replaced with the DB of choice. You can find the createInitialXXX.sql file in the /usr/share/doc/glite-amga-server/ after the installation of the server RPM:

Initialization for PostgreSQL:

  $ psql -Uarda metadata < /usr/share/doc/glite-amga-server/createInitialPG.sql

Finally activate this data source and configure the AMGA server in the amgad.config in /etc/ file as described in Configuring the AMGA Server and the Replicatin Daemon .

You should now be able to start the service and verify whether it is running by doing

  $ /etc/init.d/mdservice start
  $ tail /var/log/amgad.log 

If the server is complaining about a missing boost-library ( starting amgad: /usr/bin/amgad: error while loading shared libraries: libboost_thread-gcc-mt-1_32.so.1.32.0: cannot open shared object file: No such file or directory), create one with:

  $ su
  $ cd /usr/lib
  $ ln -s libboost_thread.so.1.32.0 libboost_thread-gcc-mt-1_32.so.1.32.0

If you want to set up AMGA and postgreSQL to start at system boot on Linux, you can use follow steps

  $ sudo chkconfig postgresql on
  $ sudo chkconfig --add mdservice

To confirm whether everything was registered properly, run the following :

  $ chkconfig --list postgresql
  $ chkconfig --list mdservice

If you want to change the configuration of the metadata server, you should go on and read Configuring the AMGA Server and the Replicatin Daemon .

Server upgrade

To upgrade from an old version(1.3, 1.9) to the 2.x version, The first thing you need is to to backup metadata.

  $ mdcli "dump /" > amga.backup

If you finished to backup your metadata, install the AMGA 2.x rpm after deleting the old version.

  $ rpm -e glite-amga-server
  $ rpm -e glite-amga-cli
  $ rpm -i emi.amga.amga-server-${version}.${platform}.rpm

After upgrading the amga software, it is necessary to upgrade the backend DB schema. Here, let us assume that you were using AMGA 1.3 and trying to upgrade to AMGA 2.1 and the backend DB used was PostgreSQL. Then, upgrading can be easily done with the following command.

  $ psql -Uarda metadata < /usr/share/doc/glite-amga-server/upgradePG_13_20.sql
  $ psql -Uarda metadata < /usr/share/doc/glite-amga-server/upgradePG_20_21.sql

Currently we provide various upgrade scripts for Oracle, MySQL5, and PostgreSQL. There are also scripts upgrading from 1.9 to 2.x version at /usr/share/doc/glite-amga-server/ directory.

If you have a failure on upgrade, it is possilbe to go back to the old version with the data backup. To recover data, you need to reinstall the old version after deleting new version and restore data as follows.

  $ mdclient < amga.backup

Installation from Source

To install the ARDA metadata server from source you will need to first download the source distribution from the download directory.

For compilation you need to install a development package for ODBC (e.g. unixodbc) This should be part of any standard distribution. On CERN SLC you simply should be able to do:

  $ yum install unixODBC unixODBC-devel

You will then need the libxml2 development library, which should also be part of any distribution. On SLC you can simply install it using

  $ yum install libxml2-devel
For the server you will finally need to install the boost libraries:
  $ yum install boost-devel

Now you should be ready to compile and install the AMGA server:

  $ tar xvfz emi.amga.amga-server-2.x.x.tar.gz
  $ cd emi.amga.amga-server-2.x.x
  $ ./configure
  $ make
  $ su
  $ make install

If you want to make rpm packages for your architecture and install them so that you will be able to deinstall them easily later or install them also on other machines, do

  $ tar xvfz emi.amga.amga-server-2.x.x.tar.gz
  $ cd emi.amga.amga-server-2.x.x
  $ ./configure --with-readline --enable-rpm-rules --without-globus
  $ make rpm  

You will need to get at least one of the currently supported 4 database backends installed, including their ODBC driver. You have the choice among PostgreSQL, MySQL, Oracle and SQLite:

PostgreSQL needs a little setup: You need to create a database and a user. Access should be made possible via TCP/IP from localhost. The scrpts/init-arda-psqldb.sh script should be able to do this for you.

Again, make sure you have a user created which gets access to the database on MySQL.

Examples of ODBC configuration files can be found in the scripts directory. Copy the odbc.ini and odbcinst.ini configurations into /etc or into your home directory (but then called .odbc.ini and .odbcinst.ini). In odbc.ini you need to configure the database used by the server and which server is being connected to. Examples are given for all 4 databases. The users(and passwords if required) must then be setup in the amgad.config file. The ODBC configuration can be checked with e.g. gODBCConfig or DataManagerII which are probably installed along the ODBC package or other ODBC clients like OpenOffice. If you don't know about ODBC, some more hints can be found in <a http://www.unixodbc.org/doc/> the Unix ODBC User Manual .

Some inital tables need to be setup in the database. You need to run one of followings to setup the database.

    $ sqlplus user/passwd < createInitialOracle.sql
    $ psql -Uuser database < createInitialPG.sql
    $ sqlite3 dbfile.db < createInitial.sql
    $ mysql database < createInitialMySQL5.sql

You should now proceed to configure the server (Configuring the AMGA Server and the Replicatin Daemon ) and start it up.

The following database and ODBC versions are known to work:

Creating a script for the site-BDII

To create script for publishing version information for AMGA server, you can use the single script as follows.

      $ su root
      $ /etc/init.d/mdservice site <SITENAME>

This script will install glite-info-provider-service(If it is not installed) and make a script file named glite-data-metadata-amga. If you already have the site-BDII then this new script file will be created in the /var/lib/bdii/gip/provider directory, otherwise, the file will be create in your home directory.

This script can be used for publishing GLUE2 information via LDAP.


Generated on Mon Apr 16 16:54:31 2012 for AMGA by  doxygen 1.4.7