|
| 1 | +# Configuring Cache Server |
| 2 | + |
| 3 | +Packages installed: `stashcache-daemon fetch-crl stashcache-cache-server` |
| 4 | + |
| 5 | +The following section describes required configuration to have a functional non-authenticated StashCache Cache (not origin server!). StashCache Cache package `stashcache-cache-server` needs to be manually configured from pre-existing XRootD configuration. |
| 6 | + |
| 7 | +## Cache server |
| 8 | +!!! Note: |
| 9 | +:bangbang: While example of the configuration file below provides combination of _authenticated_ and _non-authenticated_ _Cache_, the non-authenticated cache is considered to be default and authenticated cache just optional (additional) service. If you're about to configure in addition _authenticated cache_ read to the end of this document and then follow post-installation of [authenticated part here](configure-cache-auth.md). |
| 10 | + |
| 11 | +For configuring **cache** one needs to define directive `pss.origin redirector.osgstorage.org:1024` (not `all.manager redirector.osgstorage.org+ 1213` directive as it is in case of [configuring origin](configure-origin.md)). |
| 12 | +`StashCache-daemon` package provides default configuration file `/etc/xrootd/xrootd-stashcache-cache-server.cfg`. Example of the configuration of cache server is as follows: |
| 13 | +``` |
| 14 | +all.export / |
| 15 | +set cachedir = /stash |
| 16 | +xrd.allow host * |
| 17 | +sec.protocol host |
| 18 | +all.adminpath /var/spool/xrootd |
| 19 | +
|
| 20 | +xrootd.trace emsg login stall redirect |
| 21 | +ofs.trace all |
| 22 | +xrd.trace all |
| 23 | +cms.trace all |
| 24 | +
|
| 25 | +ofs.osslib libXrdPss.so |
| 26 | +pss.origin redirector.osgstorage.org:1094 |
| 27 | +pss.cachelib libXrdFileCache.so |
| 28 | +pss.setopt DebugLevel 1 |
| 29 | +
|
| 30 | +oss.localroot $(cachedir) |
| 31 | +
|
| 32 | +# Config for v1 (xrootd <=v4.5.0) |
| 33 | +#pfc.nramprefetch 4 |
| 34 | +#pfc.nramread 4 |
| 35 | +#pfc.diskusage 0.98 0.99 |
| 36 | +
|
| 37 | +# Config for v2 (xrootd >v4.5.0) |
| 38 | +pfc.blocksize 512k |
| 39 | +pfc.ram 32g |
| 40 | +pfc.prefetch 10 |
| 41 | +pfc.diskusage 0.98 0.99 |
| 42 | +
|
| 43 | +xrootd.seclib /usr/lib64/libXrdSec.so |
| 44 | +sec.protocol /usr/lib64 gsi \ |
| 45 | + -certdir:/etc/grid-security/certificates \ |
| 46 | + -cert:/etc/grid-security/xrd/xrdcert.pem \ |
| 47 | + -key:/etc/grid-security/xrd/xrdkey.pem \ |
| 48 | + -crl:1 \ |
| 49 | + -authzfun:libXrdLcmaps.so \ |
| 50 | + -authzfunparms:--lcmapscfg,/etc/xrootd/lcmaps.cfg,--loglevel,4|useglobals \ |
| 51 | + -gmapopt:10 \ |
| 52 | + -authzto:3600 |
| 53 | +
|
| 54 | +# Enable the authorization module, even if we have an unauthenticated instance. |
| 55 | +ofs.authorize 1 |
| 56 | +acc.audit deny grant |
| 57 | +
|
| 58 | +# Run the authenticated instance on port 8443 (Xrootd and HTTPS) |
| 59 | +# Notice authenticated and unauthenticated instances use separate auth |
| 60 | +# files. |
| 61 | +if named stashcache-cache-server-auth |
| 62 | + #pss.origin red-gridftp4.unl.edu:1094 |
| 63 | + xrd.port 8443 |
| 64 | + acc.authdb /etc/xrootd/Authfile-auth |
| 65 | + sec.protbind * gsi |
| 66 | + xrd.protocol http:8443 libXrdHttp.so |
| 67 | + pss.origin xrootd-local.unl.edu:1094 |
| 68 | +else |
| 69 | +# Unauthenticated instance runs on port 1094 (Xrootd) and 8000 (HTTP/HTTPS) |
| 70 | + acc.authdb /etc/xrootd/Authfile-noauth |
| 71 | + #sec.protbind * none |
| 72 | + sec.protbind * none |
| 73 | + xrd.protocol http:8000 libXrdHttp.so |
| 74 | +fi |
| 75 | +
|
| 76 | +http.cadir /etc/grid-security/certificates |
| 77 | +http.cert /etc/grid-security/xrd/xrdcert.pem |
| 78 | +http.key /etc/grid-security/xrd/xrdkey.pem |
| 79 | +http.secxtractor /usr/lib64/libXrdLcmaps.so |
| 80 | +http.listingdeny yes |
| 81 | +http.staticpreload http://static/robots.txt /etc/xrootd/stashcache-robots.txt |
| 82 | +
|
| 83 | +# Tune the client timeouts to more aggressively timeout. |
| 84 | +pss.setopt ParallelEvtLoop 10 |
| 85 | +pss.setopt RequestTimeout 25 |
| 86 | +pss.setopt ConnectTimeout 25 |
| 87 | +pss.setopt ConnectionRetry 2 |
| 88 | +
|
| 89 | +#Sending monitoring information |
| 90 | +xrd.report uct2-collectd.mwt2.org:9931 |
| 91 | +xrootd.monitor all auth flush 30s window 5s fstat 60 lfn ops xfr 5 dest redir fstat info user uct2-collectd.mwt2.org:9930 |
| 92 | +
|
| 93 | +all.sitename Nebraska |
| 94 | +
|
| 95 | +# Optional configuration |
| 96 | +# Remote debugging |
| 97 | +xrootd.diglib * /etc/xrootd/digauth.cf |
| 98 | +``` |
| 99 | + |
| 100 | +### Add Authfile for non-authenticated cache |
| 101 | +In Authfile you want to allow local reads below `$(cachedir)` defined in the main config. Example of Authfile: |
| 102 | +``` |
| 103 | + [root@client ~]$ cat /etc/xrootd/Authfile-noauth |
| 104 | + u * /user/ligo -rl / rl |
| 105 | +``` |
| 106 | + |
| 107 | +### Add Robots file |
| 108 | +``` |
| 109 | + [root@client ~]$ cat /etc/xrootd/stashcache-robots.txt |
| 110 | + User-agent: * |
| 111 | + Disallow: / |
| 112 | +``` |
| 113 | + |
| 114 | +### RHEL7 |
| 115 | +On RHEL7 system, you need to run following systemd unit: |
| 116 | +* `systemctl start xrootd@stashcache-cache-server.service` |
| 117 | +* `systemctl start condor.service` |
| 118 | + |
| 119 | +Please, refer to [start services document](../ops/start.md) for more information. |
| 120 | + |
| 121 | +### RHEL6 |
| 122 | +...to be added, old doc for RHEL6 configuration resides temporarily [here](https://twiki.grid.iu.edu/bin/view/Documentation/Release3/InstallStashCache). |
| 123 | + |
| 124 | +When ready with configuration, please [register](../ops/register.md) and [start](../ops/start.md) your StashCache Cache server. |
| 125 | +If you'd like to configure in addition authenticated cache instance, please follow [this](configure-cache-auth.md) document. |
0 commit comments