Skip to content

StashCache Origin Installation Guide

This document describes how to install a StashCache origin service. The installation utilizes XRootD and HTCondor for file storage and monitoring, respectively.

Installation prerequisites for Origin

Before starting the installation process, consider the following mandatory points:

  • User IDs: If they do not exist already, the installation will create the Linux user IDs condor and xrootd
  • Host certificate: The StashCache server uses a host certificate to advertise to a central collector. More information on how to retrieve a certificate can be found here
  • Network ports: The StashCache service must listen on ports:
    • XRootD service on port 1094 (TCP)
  • Hardware requirements: We recommend that a StashCache server has at least 10Gbps connectivity, 1TB of disk space, and 8GB of RAM.

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

Installing the StashCache metapackage

The StashCache daemon consists of an XRootD server and an HTCondor-based service for collecting and reporting statistics about the cache. To simplify installation, OSG provides convenience RPMs that install all required software with a single command:

[email protected] # yum install stashcache-daemon fetch-crl stashcache-cache-origin

Mount the disk that will be used for the origin data to /stash and set owner of the directory to xrootd:xrootd user.

Configuring Origin Server

The origin server connects only to a redirector (not directly to cache server), thus minimal xrootd configuration is required. StashCache-daemon package provides default configuration file /etc/xrootd/xrootd-stashcache-origin-server.cfg. Example of the configuration of origin server is as follows:

all.export /
set localroot = /stash
xrd.port 1094

all.role server
all.manager redirector.osgstorage.org+ 1213

oss.localroot $(localroot)
xrootd.trace emsg login stall redirect
ofs.trace none
xrd.trace conn
cms.trace all
sec.protocol  host
sec.protbind  * none
all.adminpath /var/spool/xrootd
all.pidpath /var/run/xrootd

# Sending monitoring information
xrd.report uct2-collectd.mwt2.org:9931
xrootd.monitor all auth flush 30s window 5s fstat 60 lfn ops xfr 5 dest redir fstat info user uct2-collectd.mwt2.org:9930

Important lines to edit:

  • set localroot = /stash: Change to the directory you would like to serve.

RHEL7

On RHEL7 system, you need to run following systemd units: [email protected] [email protected]

Origin server services

Software Service name Notes
XRootD [email protected] RHEL7
XRootD [email protected] RHEL7

Test Origin server availability in Stash Federation

To verify that your origin is being subscribed to the redirector, run the following command:

[[email protected] ~]$ xrdmapc --list s redirector.opensciencegrid.org:1094 
0**** redirector.grid.iu.edu:1094
      Srv redirector1.grid.iu.edu:2094
      Srv csiu.grid.iu.edu:1094
      Srv stash.osgconnect.net:1094
      Srv stashcache.fnal.gov:1094
      Srv redirector2.grid.iu.edu:2094
      Srv ceph-gridftp1.grid.uchicago.edu:1094

The output should list hostname of your service. If not, look for any signs of trouble in the log files or contact us at [email protected].

Start/stop services

To... Run the command... Notes
Start a service systemctl start SERVICE-NAME RHEL7
Stop a service systemctl stop SERVICE-NAME RHEL7
Status systemctl status SERVICE-NAME RHEL7
Enable systemctl enable SERVICE-NAME RHEL7