|
||||||||||||||||||||||||||||||
|
File Catalog InteractionsBefore to start to interact with the gLite File Catalog (LFC) you need to have a valid proxy with VOMS extensions. As you learned in the introductionary exercise, you can check the validity of your proxy with:
If you don't have a valid proxy yet or it is expired, type:
Be sure to have set up correctly the following environment variables:
Listing the entries of a LFC directoryThe LFC File Catalog uses a hierarchical directory structure like a regular Unix Filesystem. File Catalog administrators use the convenction to have a /grid root dir, and under this, a directory for each VO the File Catalog is supposed to support (ex.: gilda, eela, infngrid, ...). Starting from /gilda/VO_NAME, users belonging to that VO have the capability to create their own directories and register their own entries. E.g.:
lfc-ls has several parameters. You can get more
information using man lfc-ls . A common one is -l
that enables long listing showing permissions, owner, group, size and
timestamp per each entry listed. -R is
used to do recursily listing, but please use it carefully! Relative
paths can also be used. At that purpose you can define the environment
variable $LFC_HOME to point to your home catalog dir. For example:
TO DO: Take a look inside the catalog using lfc-ls LFC Directory Management
The two commands are self-explaining. Again, Summary of the LFC commands
Storage Elements InteractionsgLite provides another set of tools to deal with Storage
Elements and File Catalogs. They form the so called lcg_utils
tools.
Upload a file to a Storage Element and register it into the file catalog: lcg-cr (Copy & Register)
where:
$ lcg-infosites --vo gilda se Avail Space(Kb) Used Space(Kb) Type SEs The output is a list of SEs and related information on available/used space. lcg-cr usage example: $ touch myTest.dat In the previous example, we have created
a local file called myTest.dat and then uploaded the file into a grid
Storage Element whose hostname is opteron.gs.unina.it,
and then register the uploaded file into the File Catalog with the
LogicalFileName lfn:/grid/gilda/ischia06/tcaland/myTest.dat,
inside the LFC directory /grid/gilda/ischia06 that I have created
previously. I have also used the -v flag to get more
verbosity and the the parameter --vo gilda because I
am a member of the gilda Virtual Organization. In the output of lcg-cr, please notice that the GUID that was assigned to the file (guid:b1391277-52ed-4030-9ca2-56c0356d2c41), its SURL (srm://opteron.gs.unina.it/dpm/gs.unina.it/home/gilda/generated/2006-07-16/file5fa84a9a-376d-44e9-9381-a4a8262731e7) and the TURL (gsiftp://opteron.gs.unina.it/opteron.gs.unina.it:/storage/gilda/2006-07-16/file5fa84a9a-376d-44e9-9381-a4a8262731e7.115.0). As said during the theoretical part this morning, the GUID is a human non-readable string generated by the FileCatalog and garanteed to be unique, the SRL (Site Resource Locator) gives you information on which SE the file is actually stored, while the TURL (Transport URL Or Temporary URL) gives information on which protocol is used to access/transfer the file and its temporary because its location inside the SE can be changed by the SE deamons according to the internal policy set up by the administrator (for example, the file can be stored actually on the disk1 of a disk array and maybe moved later on disk2, or later onto a tape of the library, etc). TO DO: Create a new local file or use one already existent in your UI, upload it onto a SE, and register it in the Catalog using lcg-cr. Definition: A grid file is a file that is stored into a Storage Element AND is registered in a File Catalog (has an assigned Logical File Name). Make a replica of a grid file into another Storage Element: lcg-repwhere:
For example, let's replicate on a different Storage Element the file that we have previously uploaded: $ lcg-rep -v -d aliserv6.ct.infn.it --vo gilda lfn:/grid/gilda/ischia06/tcaland/myTest.dat Using grid catalog type: lfc Using grid catalog : lfc-gilda.ct.infn.it Source URL: lfn:/grid/gilda/ischia06/tcaland/myTest.dat File size: 0 VO name: gilda Destination specified: aliserv6.ct.infn.it Source URL for copy: gsiftp://opteron.gs.unina.it/opteron.gs.unina.it:/storage/gilda \ /2006-07-16/file5fa84a9a-376d-44e9-9381-a4a8262731e7.115.0 Destination URL for copy: gsiftp://aliserv6.ct.infn.it/aliserv6.ct.infn.it:/gpfs/dpm/gilda \ /2006-07-16/filed270060a-d8ee-4d59-8506-7cc68f47bdb8.46643.0 # streams: 1 # set timeout to 0 0 bytes 0.00 KB/sec avg 0.00 KB/sec inst Transfer took 12130 ms Destination URL registered in LRC: srm://aliserv6.ct.infn.it/dpm/ct.infn.it/home/gilda \ /generated/2006-07-16/filed270060a-d8ee-4d59-8506-7cc68f47bdb8 To inspect how many replicas a Grid File has and where they are located, you can use lcg-lr (List
Replicas):
where
–
–
For example, let's check if the previously issued replica command was successful: $ lcg-lr --vo gilda lfn:/grid/gilda/ischia06/tcaland/myTest.dat srm://aliserv6.ct.infn.it/dpm/ct.infn.it/home/gilda \ /generated/2006-07-16/filed270060a-d8ee-4d59-8506-7cc68f47bdb8 srm://opteron.gs.unina.it/dpm/gs.unina.it/home/gilda \ /generated/2006-07-16/file5fa84a9a-376d-44e9-9381-a4a8262731e7 Yes, it was: we do have two replicas (one on aliserv6 and one of opteron) of the grid file lfn:/grid/gilda/ischia06/tcaland/myTest.dat. TO DO: Make two replicas of the file you have previously uploaded and registered. Downloading a Grid file in a SE to a local destination (UI or WN) If you want to download a Grid file saved on a Storage Element to your User Interface, or you need to do that from a job running on a Worker Node, you can use the following command:
where
–
–
–
Example: $ lcg-cp -v --vo gilda lfn:/grid/gilda/ischia06/tcaland/myTest.dat file://$PWD/myTest2.dat TO DO: Download in your home the file you have previously uploaded and registered. How to delete a replicas
where
–
–
–
–
Example: $ lcg-rep -v -d gildase.oact.inaf.it --vo gilda lfn:/grid/gilda/ischia06/tcaland/myTest.dat $ lcg-lr --vo gilda lfn:/grid/gilda/ischia06/tcaland/myTest.dat srm://aliserv6.ct.infn.it/dpm/ct.infn.it/home/gilda \ /generated/2006-07-16/filed270060a-d8ee-4d59-8506-7cc68f47bdb8 srm://gildase.oact.inaf.it/dpm/oact.inaf.it/home/gilda \ /generated/2006-07-16/file1f0333e4-89c6-4fcf-ae86-a5f9938206a8 srm://opteron.gs.unina.it/dpm/gs.unina.it/home/gilda \ /generated/2006-07-16/file5fa84a9a-376d-44e9-9381-a4a8262731e7•
$ lcg-del -v -s aliserv6.ct.infn.it --vo gilda lfn:/grid/gilda/ischia06/tcaland/myTest.dat •
$ lcg-del -v -a --vo gilda lfn:/grid/gilda/ischia06/tcaland/myTest.dat TO DO: Delete the
replicas of the
file you have previously uploaded and registered and make sure that it
is also removed from the File Catalog
Top |
|||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
|