Dashboard > BaBar > ... > Root Conditions > Taking PC Snapshots
  BaBar Log In View a printable version of the current page.  
  Taking PC Snapshots
Added by Wilko Kroeger, last edited by Wilko Kroeger on Oct 06, 2008  (view change)
Labels: 
(None)

PC Snapshots

Below the procedure to take a snapshot from a PC MySQL database is described. The PC (and MASTER) MySQL databases are hosted on the bbrdbops[01-04] machines and a snapshot is taken on the same machine that hosts the database (This is only important if the root PC snapshot is made available with xrootd to the ER farms).

There are two different types of snapshots taken from a MySQL database:

  1. Root Snapshot for ER farms
    The root snapshot converts the data from the MySQL format to root files. This snapshot is used by the ER farms for processing.
  2. MySQL sync-snapshot for MASTER
    In order to copy the new conditions that were produced in a PC database to the MASTER the MySQL tables that belong to the local origin of a database are extracted. This snapshot is later loaded to the MASTER, replacing the existing databases in the MASTER. For example the PC5 database (bootfile: mysql::host=bbrdbops02,database=PC5) is of local origin PC5. The sync-snapshot extracts all databases that belong to the PC5 origin (name prefix: o272_).

Taking a snapshot

1) login as bbdatsrv to one of the bbrdbops machines:

PC Conditions FDB server
PC1, PC4 bbrdbops01
PC2,PC5 bbrdbops02
PC3,PC6 bbrdbops03

2) cd to proper release

> cd ~bbdatsrv/BabarProd1/24.3.2/
> srtpath   (Linux24SL3_i386_gcc323)

3) Take the snapshots

> KanOprTakeSnapshot -vv --bootfile <bootfile> --takeroot --takesync [--toxfer] [--toxrootd]

With:

  • <bootfile> is the bootfile of the MySQL PC database (e.g.: mysql::host=bbrdbops01,database=PC4 for PC4).
  • --takeroot take a root snapshot
  • --takesync take a sync-snapshot in order to sweep new conditions from the PC database to the MASTER.
  • --toxfer transfer the snapshot to bbr-xfer13 (for Padova)
  • --toxrootd copy the snapshot to a directory so that xrootd that runs on the same machine can access it.
    Another command has to be run in order to make the snapshot available for the clients.
Example (on bbrdbops02)
> KanOprTakeSnapshot -vv --bootfile mysql::host=bbrdbops02,database=PC5 --takeroot --takesync --toxrootd

Will take a root and sync snapshot and copy the root snapshot to the xrootd directory (/u1/store/cdb/pc5/)
on bbrdbops02.

The snapshots are created in

/kanga/snapshots/pr/fromPCi/current (where i=1...6)

Once the snapshot has been taken in the current directory it is copied to a directory named with the date the snapshot has been taken. Also all root files are prefixed with the snapshot date. The boot file (...cdb_boot.root) is updated.
For example if the snapshot was taken on October 7, 2008 at 16:45:10 the files in /kanga/snapshots/pr/fromPC5/current are copied to /kanga/snapshots/pr/fromPC5/20081007T164510/. All files are prefixed with CDB-20081007T164510- (e.g.: CDB-20081007T164510-cdb_boot.root).

The sync snapshot is in

/kanga/snapshots/pr/fromPCi/current/mySqlSync (where i=1...6)

4) Make snapshot available in Xrootd

The command below will update the name rules files for the PC snapshot in $BFROOT/kanga/config/cdb

> KanOprPCtoERxrootd -l -d <snapshotDir>

Here <snapshotDir> is the snapshot directory (with date) that was created in the previous step (e.g.:
/kanga/snapshots/pr/fromPCi/<date>.
The rules files for the PC snapshots are CdbNameRules-pci-full.cfg (i=1-6).

5) Synchronize MASTER with PC snapshot

To be written

Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.8 Build:#814 Oct 02, 2007) - Bug/feature request - Contact Administrators