Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleConditions Database Command Line Options
java -Dorg.hps.conditions.url=jdbc:mysql://hpsdb.jlab.org:3306/hps_conditions \  
    -Dorg.hps.conditions.user=hpsuser \
    -Dorg.hps.conditions.password=darkphoton [...]

...

Code Block
titleSLAC Conditions Database
java -Dorg.hps.conditions.url=jdbc:mysql://mysql-node03.slac.stanford.edu:3306/rd_hps_cond \  
    -Dorg.hps.conditions.user=rd_hps_cond_ro \
    -Dorg.hps.conditions.password=2jumpinphotons. [...] 

This database is updated only periodically, not automatically, so you may need to check if it is up-to-date before using it for your jobs.

...

Code Block
titleDownloading SQLite Database
https://github.com/JeffersonLab/hps-conditions-backup/raw/master/hps_conditions.db.tar.gz
tar -zxvf hps_conditions.db.tar.gz

This file may not be up to date with the current master in the JLab conditions database!

The local db file can be used by using this option when running Java:

...

No username or password is required when connecting locally in this way.

This file may or may not be up to date with the current master in the JLab conditions database!

Creating a Local SQLite Database

Warning

The hps_conditions.db file has to be on a disk that is local to the machine. If not then an error may occur: "Caused by: org.sqlite.SQLiteException: [SQLITE_IOERR_LOCK]  I/O error in the advisory file locking logic (disk I/O error)"  

Alternatively, if you have systems privileges (i.e. root) you can mount your NFS drive with the local_lock=all option.

Creating a Local SQLite Database

In order to create a local SQLite database, you will need to create a In order to create a local SQLite database, you will need to create a snapshot of the MySQL database and then convert it to a SQLite db file.   

...

Code Block
titleCreating a Database Dump
mysqldump --skip-extended-insert --compact -u hpsuser --password=darkphoton -h hpsdb.jlab.org --extended-insert=false --lock-tables=false hps_conditions > hps_conditions.mysql

...

Code Block
titleCreating a Backup
mysqldump -h hpsdb.jlab.org -ujeremymu$USER -pXXXXXXp$PASSWORD hps_conditions &> hps_conditions.sql

... where 'jeremym' $USER is replaced by your account name (that has with the proper permissions ) and 'XXXXXX' $PASSWORD with your password.

Loading a Conditions Database Backup

...

Code Block
titleLoading a Backup
mysql -h hpsdb.jlab.org -u jeremym$USER -pXXXXXXp$PASSWORD hps_conditions < hps_conditions.sql

...

First, from a JLab machine such as ifarm, a SQL dump should be created that includes all required statements for dropping tables (the default configuration of mysqldump should be fine).for dropping tables (the default configuration of mysqldump should be fine).

Code Block
mysqldump -h hpsdb.jlab.org -u$USER -p$PASSWORD --disable-lock-tables hps_conditions &> hps_conditions_for_slac.sql

This file should then be copied over to SLAC.

Code Block
scp hps_conditions_for_slac.sql $USER@rhel6-64.slac.stanford.edu:/nfs/slac/g/hps/someDir

Finally, the SQL dump should be loaded into the SLAC database using a command similar to the following.

Code Block
mysql -D rd_hps_cond -h mysql-node03.slac.stanford.edu -P 3306 -u $USER -p $PASSWORD <
Code Block
mysqldump -h hpsdb.jlab.org -uUSER -pPASSWORD --disable-lock-tables hps_conditions &> hps_conditions_for_slac.sql

This file should then be copied over to SLAC.

Code Block
scp hps_conditions_for_slac.sql USER@rhel6-64.slac.stanford.edu:/nfs/slac/g/hps/someDir

 The command may take awhile to execute.  If it is successful, the SLAC database should contain an exact replica of the primary conditions database from JLab.

Configuring Detector Conditions for a Job

Command Line Setup

The conditions configuration is typically performed using arguments to command line programs, or the system is setup automatically from information in the LCIO or EVIO events.

...