Personal tools
You are here: Home Experiment Information US ATLAS Grid Operations LRC Upgrade Planning

LRC Upgrade Planning

by Hironori Ito last modified Mar 22, 2007 03:23 PM
Contributors: John DeStefano

MySQL upgrade

  1. Stop DQ2 and Web interface (Apache) to LRC

  2. Backup current MySQL for LRC (at least two tables: localreplicas and mysql)

    • mysqldump --opt -u ROOTUSER -p localreplicas > localreplicas_backup.sql

    • mysqldump --opt -u ROOTUSER -p mysql > mysql_backup.sql

  3. Install new MySQL (version 5.0.xx)

    • Please use whatever appropriate for your OS/configuration.(Please remember the root password.)

  4. Install the old password/account data into new MySQL

    • mysql mysql < mysql_backup.sql

    • You need to restart mysql (or flush privillege) to make your change.

  5. Install the old localreplicas to new MySQL

    • mysqladmin -u ROOTUSER -p create localreplicas

    • mysql localrepicas < localreplicas_backup.sql

  6. Check localreplicas database

    • login to MySQL as dq2user (or whatever you decided to use of DQ2/LRC. Check TiersOfATLASCache.py in DQ2/common directory)

    • use localreplicas;

    • show tables;

      This should show:

    +-------------------------+
    | Tables_in_localreplicas |
    +-------------------------+
    | t_lfn                   |
    | t_meta                  |
    | t_metaspec              |
    | t_pfn                   |
    +-------------------------+
    
    • Make sure you can read all tables in general The following SQL commands should return some non-zero numbers (without any errors).

      • select count(*) from t_lfn;

      • select count(*) from t_meta;

      • select count(*) from t_metaspec;

      • select count(*) from t_pfn;

    • Check the current t_pfn schema

      • describe t_pfn;

        This should show:

    +----------+---------------------+------+-----+---------+-------+
    | Field    | Type                | Null | Key | Default | Extra |
    +----------+---------------------+------+-----+---------+-------+
    | pfname   | varchar(250) binary |      | PRI |         |       |
    | guid     | varchar(40) binary  | YES  | MUL | NULL    |       |
    | filetype | varchar(250) binary | YES  |     | NULL    |       |
    +----------+---------------------+------+-----+---------+-------+
    
  7. Upgrade schema

    • log into MySQL as ROOT

    • change to localreplicas tables by use localreplicas;

    • update schema by alter table t_pfn modify pfname varchar(512);

      NOTE: It is possible that you may not be able to change it to varchar(512). If you can not, check what "character_set" is using in MySQL with:

    show variables like character%
    #In BNL LRC MySQL:
    +--------------------------+----------------------------+
    | Variable_name            | Value                      |
    +--------------------------+----------------------------+
    | character_set_client     | latin1                     |
    | character_set_connection | latin1                     |
    | character_set_database   | latin1                     |
    | character_set_filesystem | binary                     |
    | character_set_results    | latin1                     |
    | character_set_server     | latin1                     |
    | character_set_system     | utf8                       |
    | character_sets_dir       | /usr/share/mysql/charsets/ |
    +--------------------------+----------------------------+
    

    It is possible you are not using latin1 such as utf8. You need to change it latin1 since some other character sets use more bytes per character. To change the character_set_database to latin1, do

    set character_set_database=latin1
    

    After you change it to latin1 (as BNL), you should be able to change your schema.

POOL interface modification

  1. Stop web interface (Apache) if it is running.

  2. Go to the root directory for web interface codes. (not system root directory)

  3. Find set.sh (or something equivalent)

    • In the setup.sh file, you should find POOL_VERSION, SCRAM_ARCH variables.

    • You must source this file to set these variables: source setup.sh

  4. Check if scram program works by scram list

    • In BNL, this lists the following:

    Listing installed projects....
    --------------------------------------------------------------------------------
    | Project Name  | Project Version          | Project Location                  |
    --------------------------------------------------------------------------------
      SEAL            SEAL_1_7_1
                                             --> /opt/dq/DQ2_0_1_4_site/pool/app/releases/SEAL/SEAL_1_7_1
    POOL POOL_2_1_2 --> /opt/dq/DQ2_0_1_4_site/pool/app/releases/POOL/POOL_2_1_2
    Projects available for platform >> slc3_ia32_gcc323 <<

    NOTE: It is possible that the version of POOL and SEAL is different from BNL. If the above scram command does not work, please check your PATH and LD_LIBRARY_PATH as well as POOL_VERSION and SCRAM_ARCH variables. scram should be located LRC_WEB_DIR/pool/app/spi/scram directory.

  5. Go to LRC_WEB_DIR/pool/app/releases/POOL/POOL_2_1_2/src/MySQLCatalog directory

  6. Modify src/MySQLFileCatalog.cpp

    • Since it might be different POOL version, the line number is not provided. Please open the source code and find the relevant codes as instructed below.

    • You will change two methods in this class: renamePFN and insertPFN

      • Find the renamePFN method by searching for MySQLFileCatalog::renamePFN

        • In this method, you will find:


          Change this 250 to 512:


    • Find insertPFN by searching for MySQLFileCatalog::insertPFN

      • In this method, you will find


        Change this 250 to 512:


  7. Recompile POOL

    • Make sure that you are not at MySQLCatalog/src directory. You need to be in the MySQLCatalog directory.

    • Recompile with scram b

    • If this command is successful, recompilation is complete.

Document Actions