Tutorial srm/dcache...
Tips and tricks to use our srm/dcache servers both at Lyon and Brookhaven...
Certificate
To use srm/dcache, one needs a certificate. Ermias and Raphael have
one, provided by the DOE, through https://pki1.doegrids.org/ca/
> openssl pkcs12 -in doe.p12 -clcerts -nokeys -out usercert.pem
> openssl pkcs12 -in doe.p12 -nocerts -out userkey.pem
(ask you for a passphrase)
>mkdir .globus
>mv user* .globus/.
>chmod 600 .globus/*
Your certificate is here !
To write in a given directory, your certificate needs to be mapped to a permitted account by the dcache master (Ofer Rind at RCF, Lionel Schwarz at CCF)
Environment
Then you need the proper environment.@CCF > lcg_env
(now available for SL3 and SL4 on the batch, not working interactively on SL4)
@RCF > source ~raphael/Srm/srm_setup.csh
Then, each time you want to transfer, you need to set up a proxy
> grid-proxy-init
Another way to get it is to dump a long standing proxy and to point to it. That's what we (phnxreco) did to be able to use srmcp from the workers:
> setenv X509_USER_PROXY ~/private/dcache_proxy
To check the status of your proxy
> grid-proxy-info
Transfers
Beware : from Sep 3rd, srmcp neeed the option -protocols=gsiftp.Update : on Nov 22nd, seems to work without the option (at least on SL3)
That's it, you can play, for instance :
@CCF, copy from /sps/phenix/ to srm/dcache
> srmcp -protocols=gsiftp file:////sps/phenix/Run7AuAu/reco/dsts/pro.76_june.1/run_0000238000_0000239000/EWG_LVL2/
EWG_lvl2_run7AuAu_200GeV_online-0000238027-0009.root $SRM/phnxreco/test/EWG_lvl2_run7AuAu_200GeV_online-0000238027-0009.root
$SRM was set to srm://ccsrm02.in2p3.fr:8443/pnfs/in2p3.fr/data/phenix
@CCF, copy from /sps/phenix to srm/dcache @ RCF !
> srmcp -protocols=gsiftp file:////sps/phenix/Run7AuAu/reco/dsts/pro.76_june.1/run_0000238000_0000239000/EWG_LVL2/
EWG_lvl2_run7AuAu_200GeV_online-0000238027-0009.root $SRCF/test/phnxreco/EWG_lvl2_run7AuAu_200GeV_online-0000238027-0009.root
$SRCF was set to srm://phnxsrm.rcf.bnl.gov:8443/pnfs/rcf.bnl.gov/phenix
@CCF, copy from srm/dcache @ CCF to srm/dcache @ RCF !
> srmcp -pushmode $SRM/phnxreco/test/EWG_lvl2_run7AuAu_200GeV_online-0000238027-0011.root $SRCF/test/phnxreco/EWG_lvl2_run7AuAu_200GeV_online-0000238027-0011.root
Oct 9th : it only works in pushmode for now. Under investigation...
@RCF, copy from disk to srm/dcache @ CCF
> srmcp file:////afs/rhic/phenix/users/raphael/daq.dump srm://ccsrm02.in2p3.fr:8443/pnfs/in2p3.fr/data/phenix/phnxreco/test/daq.dump
Browsing
@CCF, you can browse RCF directly...> srmls $SRCF/test/phnxreco/
@CCF, you can browse CCF through :
> /usr/local/products/dcache/client/old/srm/bin/srmls $SRM
$SRM was set to srm://ccsrm02.in2p3.fr:8443/pnfs/in2p3.fr/data/phenix
Beware that the variable $SRM_PATH must be set to null or /usr/local/products/dcache/client/old/srm/
If the above is not working, though it is not recommended, you can also use :
> setenv LD_PRELOAD /usr/local/products/dcache/client/prod/dcap/lib/libpdcap.so
> ls $DCCP/
$DCCP was set to dcap://ccdcache02.in2p3.fr:22125/pnfs/in2p3.fr/data/phenix
Delete
Beware, srmcp do not overwrite existing file. To delete a file :> srm-advisory-delete $SRM/phnxreco/test/EWG_lvl2_run7AuAu_200GeV_online-0000238027-0011.root
To delete a directory you should ask help to the dcache-master.
Checks
To check that files are coming from rcf to ccf, log on at RCF and look in the database... Status = 0 means successful transfer... Offline_flag=0 means atp filtered, 1 means offline filtered...> psql daq
daq=> select filename,status,offline_flag,time from ccftransfer where time>'2007-11-23' order by time;
Then you can >ls $DCCP/run7/lefichier or ls $DCCP/run7_rcf/lefichier to double check that lefichier really made it...