Technical-CMS-DBS

About NDGF

About
People
Meetings
Forums
Steering Board

Documents

Presentations
Technical
Managemental
Links

Activities

Planning
Operation
Middleware
Tier-1

e-Science Projects

CERN
BioGrid
CO2
CC-VO


Added by Erik Edelmann, last edited by Erik Edelmann on Jun 03, 2008  (view change)

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

Installation of a local DBS

The DBS (Dataset Bookeeping Service) is used to keep track of datasets. It basically consists of a database (operated by MySQL or Oracle) with a Tomcat applet interface.

ProdAgent uses two DBS:s: one global and one local. The global DBS is used to keep track of finished, merged datasets, and is administered centrally at CERN, so T1/T2 sites do not need to worry about it themselves. The "local" DBS can be running either at CERN (in which case CERN has to be asked to set it up), or locally. These instructions are for those who choose the latter alternative.

Installing packages

First, install the needed packages. This is most easily done in the same way as in the CMSSW installation using a bootstrap script and APT.

We'll install the packages under /opt/prodagent, and store a database under $HOME. Feel free to change values of the variables WORKDIR and BASE_DIR as you please.

export WORKDIR=$HOME/prodagent
export BASE_DIR=/opt/prodagent
export SCRAM_ARCH=slc4_ia32_gcc345
export DBSVERSION=DBS_1_0_8        # Or whatever version you are going to use

cd $BASE_DIR

wget  http://cmsrep.cern.ch/cmssw/bootstrap-$SCRAM_ARCH.sh
sh -x bootstrap-$SCRAM_ARCH.sh setup
source $SCRAM_ARCH/external/apt/0.5.15lorg3.2-CMS3/etc/profile.d/init.sh
apt-get install cms+dbs-client+$DBSVERSION cms+dbs-server+$DBSVERSION cms+dbs-schema+$DBSVERSION

Setting up a database server

We'll use MySQL:

source $BASE_DIR/$SCRAM_ARCH/external/mysql/<version>/etc/profile.d/init.sh
mysql_install_db --datadir=$WORKDIR/mysqldata
mysqld_safe --datadir=$WORKDIR/mysqldata \
       --max_allowed_packet=16777216 \
       --port=6306 \
       --socket=/tmp/mysql2.sock \
       --log-error=$WORKDIR/mysqldata/error.log \
       --pid-file=$WORKDIR/mysqldata/mysqld.pid &

Replace <version> with whatever version number you've got installed. And feel free to chose other port numbers and socket files (or rely on the defaults).

Set a password for the 'root' user, and import a schema:

mysqladmin -u root password mypasswd --socket=/tmp/mysql2.sock
mysql -u root -pmypasswd --socket=/tmp/mysql2.sock \
        < $BASE_DIR/$SCRAM_ARCH/cms/dbs-schema/$DBSVERSION/Schema/NeXtGen/DBS-NeXtGen-MySQL_DEPLOYABLE.sql

Setting up Tomcat

(Again, replace <version> with whatever you have.)

  • First, a few environment variables:
    export CATALINA_HOME=$BASE_DIR/$SCRAM_ARCH/external/apache-tomcat/<version>/
    export JAVA_HOME=$BASE_DIR/$SCRAM_ARCH/external/java-jdk/<version>/
    alias javac=$JAVA_HOME/bin/javac
    
  • Add the line
    JAVA_OPTS="$JAVA_OPTS -Xmx2048m"
    

    to the file $CATALINA_HOME/bin/catalina.sh

  • If you don't want to use the default port numbers (8080 etc), edit port numbers in $CATALINA_HOME/conf/server.xml
  • Go to $BASE_DIR/$SCRAM_ARCH/cms/dbs-server/$DBSVERSION/Servers/JavaServer/etc and edit the file context.xml (or create one from context.xml.tobe). This file is needed to tell Tomcat how to connect to your database.
  • Compile the server applet:
    cd ..
    . $BASE_DIR/$SCRAM_ARCH/external/apache-ant/<version>/etc/profile.d/init.sh
    ant dist
    
  • Copy the DBS server java applet to Tomcat:
    cp DBS.war $CATALINA_HOME/webapps
    cp $BASE_DIR/$SCRAM_ARCH/cms/dbs-server/$DBSVERSION/Servers/JavaServer/lib/mysql-connector-java-5.0.5-bin.jar\
        $CATALINA_HOME/common/lib/
    
  • (Optional) Test that the server can talk to the database
    cd test
    ./runAllTest.sh
    
  • Start Tomcat:
    . $CATALINA_HOME/etc/profile.d/init.sh
    $CATALINA_HOME/bin/startup.sh
    
  • Set up the DBS client; edit the file
    $BASE_DIR/$SCRAM_ARCH/cms/dbs-client/$DBSVERSION/lib/Clients/Python/DBSAPI/dbs.config; set the URL parameter to your DBS applet:
    URL=http://localhost:<portnumber>/DBS/servlet/DBSServlet
    
  • (Optional) Test the client
    . $BASE_DIR/$SCRAM_ARCH/cms/dbs-client/$DBSVERSION/etc/profile.d/init.sh
    cd $BASE_DIR/$SCRAM_ARCH/cms/dbs-client/$DBSVERSION/lib/Clients/Python/
    . setup.sh
    cd DBSAPI/UnitTests/
    ./runAllTests.sh