Skip to content

Using XRootD

XRootD is a high performance data system widely used by several science VOs on OSG to store and to distribute data to jobs. It can be used to create a data store from distributed data nodes or to serve data to systems using a distributed caching architecture. Either mode of operation requires you to install the XRootD client software.

This page provides instructions for accessing data on XRootD data systems using a variety of methods.

As a user you have three different ways to interact with XRootD:

  1. Using the XRootD clients
  2. Using a XRootDFS FUSE mount to access a local XRootD data store
  3. Using LD_PRELOAD to use XRootD libraries with Unix tools

We'll show how to install the XRootD client software and use all three mechanisms to access data.

Note

Only the client tools method should be used to access XRootD systems across a WAN link.

Before Starting

As with all OSG software installations, there are some one-time (per host) steps to prepare in advance:

If you are using the FUSE mount, you should also consider the following requirement:

  • User IDs: If it does not exist already, you will need to create a xrootd user

Using the XRootD client software

Installing the XRootD Client

If you are planning on interacting with XRootD using the XRootD client, then you'll need to install the XRootD client RPM.

Installing the XRootD Client RPM

The following steps will install the rpm on your system.

  1. Clean yum cache:

    [email protected] $ yum clean all --enablerepo=\*
    
  2. Update software:

    [email protected] $ yum update
    

    This command will update all packages

  3. Install XRootD Client rpm:

    [email protected] $ yum install xrootd-client
    

Using the XRootD Client

Once the xrootd-client rpm is installed, you should be able to use the xrdcp command to copy files to and from XRootD systems and the local file system. For example:

[email protected] $ echo "This is a test" >/tmp/test 
[email protected] $ xrdcp /tmp/test xroot://redirector.domain.org:1094//storage/path/test 
[email protected] $ xrdcp xroot://redirector.domain.org:1094//storage/path/test /tmp/test1 
[email protected] $ diff /tmp/test1 /tmp/test 

For other operations, you'll need to use the xrdfs command. This command allows you to do file operations such as creating directories, removing directories, deleting files, and moving files on a XRootD system, provided you have the appropriate authorization. The xrdfs command can be used interactively by running xrdfs xroot://redirector.domain.org:1094/. Alternatively, you can use it in batch mode by adding the xrdfs command after the xroot URI. For example:

[email protected] $ echo "This is a test" >/tmp/test 
[email protected] $ xrdfs xroot://redirector.domain.org:1094/  mkdir  /storage/path/test
[email protected] $ xrdcp xroot://redirector.domain.org:1094//storage/path/test/test1 /tmp/test1 
[email protected] $ xrdfs xroot://redirector.domain.org:1094/  ls  /storage/path/test/test1
[email protected] $ xrdfs xroot://redirector.domain.org:1094/  rm  /storage/path/test/test1
[email protected] $ xrdfs xroot://redirector.domain.org:1094/  rmdir  /storage/path/test

Note

To access remote XRootD resources, you will may need to use a VOMS proxy in order to authenticate successfully. The XRootD client tools will automatically locate your proxy if you generate it using voms-proxy-init, otherwise you can set the X509_USER_PROXY environment variable to the location of the proxy XRootD should use.

Validation

Assuming that there is a file called test_file in your XRootD data store, you can do the following to validate your installation. Here we assume that there is a file on your XRootD system at /storage/path/test_file.

[email protected] $ xrdcp xroot://redirector.yourdomain.org:1094//storage/path/test_file /tmp/test1

Using XRootDFS FUSE mount

This section will explain how to install, setup, and interact with XRootD using a FUSE mount. This method of accessing XRootD only works when accessing a local XRootD system.

Installing the XRootD FUSE RPM

If you are planning on using a FUSE mount, you'll need to install the xrootd-fuse rpm by running the following commands:

  1. Clean yum cache:

    [email protected] $ yum clean all --enablerepo=\*
    
  2. Update software:

    [email protected] $ yum update
    
  3. Install XRootD FUSE rpm:

    [email protected] $ yum install xrootd-fuse
    

Configuring the FUSE Mount

Once the appropriate rpms are installed, the FUSE setup will need further configuration. See this for instructions on updating your fstab file.

Using the XRootDFS FUSE Mount

The directory mounted using XRootDFS can be used as any other directory mounted on your file system. All the normal Unix commands should work out of the box. Try using cp, rm, mv, mkdir, rmdir.

Assuming your mount is /mnt/xrootd:

[email protected] $ echo "This is a new test" >/tmp/test 
[email protected] $ mkdir -p /mnt/xrootd/subdir/sub2
[email protected] $ cp /tmp/test /mnt/xrootd/subdir/sub2/test 
[email protected] $ cp /mnt/xrootd/subdir/sub2/test /mnt/xrootd/subdir/sub2/test1 
[email protected] $ cp /mnt/xuserd/subdir/sub2/test1 /tmp/test1 
[email protected] $ diff /tmp/test1 /tmp/test 
[email protected] $ rm -r /mnt/xrootd/subdir

Validation

Assuming your mount is /mnt/xrootd and that there is a file called test_file in your XRootD data store:

[email protected] $ cp /mnt/xrootd/test_file /tmp/test1

Using LD_PRELOAD to access XRootD

Installing XRootD Libraries For LD_PRELOAD

In order to use LD_PRELOAD to access XRootD, you'll need to install the XRootD client libraries.
The following steps will install them on your system:

  1. Clean yum cache:

    [email protected] $ yum clean all --enablerepo=\*
    
  2. Update software:

    [email protected] $ yum update
    

    This command will update all packages

  3. Install XRootD Client rpm:

    [email protected] $ yum install xrootd-client
    

Using LD_PRELOAD method

In order to use the LD_PRELOAD method to access a XRootD data store, you'll need to change your environment to use the XRootD libraries in conjunction with the standard Unix binaries. This is done by setting the LD_PRELOAD environment variable. Once this is done, the standard unix commands like mkdir, rm, cp, etc. will work with xroot URIs. For example:

[email protected] $ export LD_PRELOAD=/usr/lib64/libXrdPosixPreload.so 
[email protected] $ echo "This is a new test" >/tmp/test 
[email protected] $ mkdir xroot://redirector.yourdomain.org:1094//storage/path/subdir
[email protected] $ cp /tmp/test xroot://redirector.yourdomain.org:1094//storage/path/subdir/test 
[email protected] $ cp xuser://redirector.yourdomain.org:1094//storage/path/subdir/test /tmp/test1 
[email protected] $ diff /tmp/test1 /tmp/test 
[email protected] $ rm xroot://redirector.yourdomain.org:1094//storage/path/subdir/test 
[email protected] $ rmdir xroot://redirector.yourdomain.org:1094//storage/path/subdir

Validation

Assuming that there is a file called test_file in your XRootD data store, the following steps will validate your installation:

[email protected] $ export LD_PRELOAD=/usr/lib64/libXrdPosixPreload.so
[email protected] $ cp xroot://redirector.yourdomain.org:1094//storage/path/test_file /tmp/test1

How to get Help?

If you cannot resolve the problem, the best way to get help is by contacting osg-software@opensciencegrid.org. For a full set of help options, see Help Procedure.