GridStorageAccess: Difference between revisions

From T2B Wiki
Jump to navigation Jump to search
No edit summary
Line 4: Line 4:
=== Before starting ===
=== Before starting ===
[[Image(UsefulImages:Exclamation_mark.png,height=50)]]Before being able to run these commands you first need to make a valid proxy <br>
[[Image(UsefulImages:Exclamation_mark.png,height=50)]]Before being able to run these commands you first need to make a valid proxy <br>
*'''voms-proxy-init --voms cms:/cms/becms'''
*'''voms-proxy-init --voms cms'''
 
=== SRM ===
=== SRM ===
The SRMv2 interface to most grid storage completely replaces most of the EDG commands.
The SRMv2 interface to most grid storage completely replaces most of the EDG commands.

Revision as of 13:48, 21 January 2016

THIS IS MOSTLY DEPRECATED ! PLEASE USE lcg-* COMMAND RATHER THAN srm* ONES !! (lcg-+TAB & man is your friend !)

This page describes how to handle data stored on grid storage.

Before starting

Image(UsefulImages:Exclamation_mark.png,height=50)Before being able to run these commands you first need to make a valid proxy

  • voms-proxy-init --voms cms

SRM

The SRMv2 interface to most grid storage completely replaces most of the EDG commands.

srm-commands

  • srmls: get information on a file
  • srmmv: rename a file
  • srmrmdir: remove a directory
  • srmmkdir: create a directory
  • srmrm: remove a file
  • srmcp: copy files (still uses protocol v1!!)

usage

  • newer srm clients support transparent usage of the srm version
    • in case this doesn't work, please use the equivalent command as listed in the OLD usage section below
  • srm<command> --help will print out very detailed info on how to use the commands
    • example usage can be found at the end of the help output
  • an srm-url has following possible forms
    • srm://<name_of_server>:<port>/some/path
    • remote access to file/directory
    • this is what you will be using
    • file:////some/path
    • local access to file/directory
    • the 4 / are really needed

examples

  • list contents of a directory /pnfs/iihe/cms on machine maite.iihe.ac.be
   srmls srm://maite.iihe.ac.be:8443/pnfs/iihe/cms
  • create a directory
  srmmkdir srm://maite.iihe.ac.be:8443/pnfs/iihe/cms/stdweird/kkllddsrm
  • copy file from local disk to remote server
  srmcp file:////bin/bash srm://maite.iihe.ac.be:8443/pnfs/iihe/cms/stdweird/kkllddsrm/file
  • delete a file on remote server
  srmrm srm://maite.iihe.ac.be:8443/pnfs/iihe/cms/stdweird/kkllddsrm/file
  • remove a directory on remote server
  srmrmdir srm://maite.iihe.ac.be:8443/pnfs/iihe/cms/stdweird/kkllddsrm
 The directory must be empty. There is a "recursive" option, but this only applies if the directory to delete only contains empty sub-directories :
  srmrmdir -recursive=true srm://maite.iihe.ac.be:8443/pnfs/iihe/cms/stdweird/kkllddsrm  

Bulk file transfers

There is an elegant way to run srmcp through several files. This is done using the copyjobfile option within a srmcp command.

Here are the details on how to use multiple srm instance in one command. Notice that the order it will process files is not necessarily the one listed in your input file.

Syntax:

srmcp -copyjobfile=datafile

where datafile is a file where every line is a source + destination in srm url syntax as followed (in other words source and destination IN ONE LINE):

       source                                    destination
srm://maite.iihe.ac.be:8443/pnfs/iihe/blabla file:///$PWD/blalbla

or, directly from a remote srm storage to our dCache:

srm://srm-eoscms.cern.ch:8443/srm/v2/server?SFN=/eos/cms/store/group/comm_trigger/L1TrackTrigger/BE5D_620_SLHC6/singleMu/NoPU/reDIGI_SLHC6-TrackTrigger_muon_pgun-0499.root srm://maite.iihe.ac.be:8443/pnfs/iihe/cms/store/user/odevroed/eosTransfer.root


Make some tests with one line in datafile and make sure the srm url is OK for both source and destination before running over several files.

If you have any issue try with -debug and try to force -streams_num=1 and put this options as well -srm_protocol_version=2 -globus_tcp_port_range=21000,25000


copy directories from and pnfs within the IIHE

A script to copy full directories to and from pnfs exists on the slc6 UI's:

copyDirectoryPnfs.py
Move all files in a directory to or from pnfs
This script assumes that you copy within the IIHE
The script does not do recursive copying
Make sure you have a valid proxy, made with voms-proxy-init --voms cms:/cms/becms

Mandatory options:
--in=                 : directory to copy from
--out=                : directory to copy to
Both directories need to be complete (i.e. including the /pnfs or /user part

example:
copyDirectoryPnfs.py --out=/user/odevroed/newfile --in=/pnfs/iihe/cms/store/user/odevroed/newdir

Optional:
-h, --help             : print this help message


dCache

Direct dcache access to files is only possible if the software supports it. PNFS (the directory structure seen under /pnfs/) is NOT a real filesystem, so normal system commands will mmostly not work.

  • Commands that work
    • ls
  • replacemnt command:
    • dccp (to copy files from /pnfs to local disk or reverse)
  • ROOT has dcache support
    • to open files in dcache using root, use eg
  root dcap://maite.iihe.ac.be/pnfs/iihe/some/file.root

When reading out the rootfiles is rather slow or it doesn't work at all and nothing is wrong with the root file (e.g. in an interactive analysis on beo or msa) you can increase your dCache readahead buffer. Don't make the buffer larger than 50MB! To enlarge the buffer set this in you environment for csh:

setenv DCACHE_RAHEAD 1
setenv DCACHE_RA_BUFFER 50000000

For bash:

export DCACHE_RAHEAD=true
export DCACHE_RA_BUFFER=50000000

See the dChache fanpage for further reading.

EDG

Older edg-gridftp-* commands.

  • uses gsiftp://<server>/path/to/file protocol for remote files


Template:TracNotice