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:

    root@client $ yum clean all --enablerepo=\*
    
  2. Update software:

    root@client $ yum update
    

    This command will update all packages

  3. Install XRootD Client rpm:

    root@client $ 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:

user@client $ echo "This is a test" >/tmp/test 
user@client $ xrdcp /tmp/test xroot://redirector.domain.org:1094//storage/path/test 
user@client $ xrdcp xroot://redirector.domain.org:1094//storage/path/test /tmp/test1 
user@client $ 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:

user@client $ echo "This is a test" >/tmp/test 
user@client $ xrdfs xroot://redirector.domain.org:1094/  mkdir  /storage/path/test
user@client $ xrdcp xroot://redirector.domain.org:1094//storage/path/test/test1 /tmp/test1 
user@client $ xrdfs xroot://redirector.domain.org:1094/  ls  /storage/path/test/test1
user@client $ xrdfs xroot://redirector.domain.org:1094/  rm  /storage/path/test/test1
user@client $ 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.

user@client $ 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:

    root@client $ yum clean all --enablerepo=\*
    
  2. Update software:

    root@client $ yum update
    
  3. Install XRootD FUSE rpm:

    root@client $ yum install xrootd-fuse
    

Configuring the FUSE Mount

Once the appropriate RPMs are installed, the FUSE setup will need further configuration.

Modify /etc/fstab by adding the following entries:

....
xrootdfs                /mnt/xrootd              fuse    rdr=xroot://<REDIRECTOR FQDN>:1094/<PATH TO FILE>,uid=xrootd 0 0

Replace /mnt/xrootd with the path that you would like to access with. Create /mnt/xrootd directory. Make sure the xrootd user exists on the system. Once you are finished, you can mount it:

mount /mnt/xrootd

You should now be able to run UNIX commands such as ls /mnt/xrootd to see the contents of the XRootD server.

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:

user@client $ echo "This is a new test" >/tmp/test 
user@client $ mkdir -p /mnt/xrootd/subdir/sub2
user@client $ cp /tmp/test /mnt/xrootd/subdir/sub2/test 
user@client $ cp /mnt/xrootd/subdir/sub2/test /mnt/xrootd/subdir/sub2/test1 
user@client $ cp /mnt/xuserd/subdir/sub2/test1 /tmp/test1 
user@client $ diff /tmp/test1 /tmp/test 
user@client $ 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:

user@client $ 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:

    root@client $ yum clean all --enablerepo=\*
    
  2. Update software:

    root@client $ yum update
    

    This command will update all packages

  3. Install XRootD Client rpm:

    root@client $ 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:

user@client $ export LD_PRELOAD=/usr/lib64/libXrdPosixPreload.so 
user@client $ echo "This is a new test" >/tmp/test 
user@client $ mkdir xroot://redirector.yourdomain.org:1094//storage/path/subdir
user@client $ cp /tmp/test xroot://redirector.yourdomain.org:1094//storage/path/subdir/test 
user@client $ cp xuser://redirector.yourdomain.org:1094//storage/path/subdir/test /tmp/test1 
user@client $ diff /tmp/test1 /tmp/test 
user@client $ rm xroot://redirector.yourdomain.org:1094//storage/path/subdir/test 
user@client $ 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:

user@client $ export LD_PRELOAD=/usr/lib64/libXrdPosixPreload.so
user@client $ cp xroot://redirector.yourdomain.org:1094//storage/path/test_file /tmp/test1

How to get Help?

If you cannot resolve the problem, please consult this page for assistance..

Back to top