wiki:manuals/Managing
Last modified 10 years ago Last modified on 11/28/07 11:48:38

There are 2 configuration files in dCache 1.8 strongly bound together :

  • /opt/d-cache/config/PoolManager.conf ont the head node running dCache domain
  • /opt/d-cache/config/LinkGroupAuthorization.conf on the SRM server

To avoid typos, configuration errors and so on, we described the configuration in an XML schema and wrote some straightforward XSL stylesheets. This allows us to represent groups and items as part of a group with parameters.

The schema looks like :

<ROOT>
  <unitgroup name="ugroup-1">
      <unit mode="store" name="monitor:dteam@osm"/>
      <unit mode="store" name="monitor:atlas@osm"/>
  </unitgroup>
  <unitgroup name="ugroup-world">
      net" name="0.0.0.0/0.0.0.0"/>
  </unitgroup>
  <unitgroup name="ugroup-any-protocol">
      <unit mode="protocol" name="*/*"/>
  </unitgroup>
  
  <poolgroup name="pgroup-dteam-disk">
      <pool name="pool-dteam-disk-1"/>
      <pool name="pool-dteam-disk-2"/>      
  </poolgroup>

  <linkGroup name="linkgroup-dteam-t0d1" custodial="false" output="true" replica="true" nearline="false" online="true">
            <link name="link-disk-sc3" ugroup1="ugroup-1"  pgroup="pgroup-dteam-disk" rp="10" wp="10" cp="10" pp="-1"/>
            <Authorization>
/dteam/Role=production
/dteam/Role=lcgadmin
lcgdteam/Role=*
            </Authorization>
  </linkGroup>
</ROOT>

Now you can apply your XML description on the sstylesheets attached to this page to obtain a typo free configuration file.

LinkGroupAuthorization?.xsl :

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <!-- Import Modules -->
    <!-- output format -->
    <xsl:output method="text" indent="no" omit-xml-declaration="yes"/>
    <!-- Parameter -->
    <!-- Matching Rules -->
    <xsl:template match="/">
        <xsl:apply-templates select="//linkGroup"/>
    </xsl:template>

    <xsl:template match="linkGroup">
linkGroup <xsl:value-of select="@name"/>
<xsl:value-of select="Authorization"/><xsl:text>
</xsl:text>
    </xsl:template>
</xsl:stylesheet>

poolmanagerconfig.xsl :

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <!-- Import Modules -->
    <!-- output format -->
    <xsl:output method="text" indent="no" omit-xml-declaration="yes"/>
    <!-- Parameter -->
    <!-- Matching Rules -->
    <xsl:template match="/">
    <!-- Preamble-->
#
# Setup of poolManager diskCacheV111.poolManager.RequestContainerV5
#

set timeout pool 120

<xsl:value-of select="//preamble"/>

    <!-- Unit Creation -->
#
# The Units ...
#
<xsl:apply-templates select="//unit"/>
    <!-- This loop finds unique Ugroups from all UNIT -->
#
# The unit Groups ...
#
<xsl:apply-templates select="//unitgroup"/>
#
# The pools ...
#
    <!-- Pool Creation -->
<xsl:apply-templates select="//poolgroup/pool"/>
#
# The pool groups ...
#
<xsl:apply-templates select="//poolgroup"/>
#
# The Links
#
<xsl:apply-templates select="//link"/>
#
# The LinkGroups
#
<xsl:apply-templates select="//linkGroup"/>

<!-- Submodules entries -->
#
# Submodule [rc] : class diskCacheV111.poolManager.RequestContainerV5
#
rc onerror suspend
rc set max retries 3
rc set retry 900
rc set warning path billing
rc set poolpingtimer 600
rc set max restore unlimited
rc set sameHostCopy besteffort
rc set max threads 0
set pool decision -cpucostfactor=1.0 -spacecostfactor=1.0
set costcuts -idle=0.0 -p2p=2.0 -alert=0.0 -halt=0.0 -fallback=0.0
rc set p2p on
rc set p2p oncost
rc set stage oncost off
rc set p2p oncost
rc set stage oncost off
rc set stage on
rc set slope 0.0
rc set max copies 500
pm set transferbuffer -spacecostfactor=0.0

</xsl:template>

<xsl:template match="unit">
psu create unit -<xsl:value-of select="@mode"/> <xsl:text> </xsl:text> <xsl:value-of select="@name"/>
</xsl:template>

<xsl:template match="unitgroup">
psu create ugroup <xsl:value-of select="@name"/>
<xsl:for-each select="unit">
psu addto ugroup <xsl:value-of select="../@name"/> <xsl:text> </xsl:text> <xsl:value-of select="@name"/>
</xsl:for-each>
</xsl:template>

<xsl:template match="poolgroup/pool">
psu create pool <xsl:value-of select="@name"/>
</xsl:template>

<xsl:template match="poolgroup">
psu create pgroup <xsl:value-of select="@name"/>
<xsl:for-each select="pool">
psu addto pgroup <xsl:value-of select="../@name"/> <xsl:text> </xsl:text> <xsl:value-of select="@name"/>
</xsl:for-each>
</xsl:template>

<xsl:template match="link">
psu create link <xsl:value-of select="@name"/> <xsl:text> </xsl:text> <xsl:value-of select="@ugroup2"/> <xsl:text> </xsl:text> <xsl:value-of select="@ugroup1"/>
psu set link <xsl:value-of select="@name"/> -readpref=<xsl:value-of select="@rp"/> -writepref=<xsl:value-of select="@wp"/> -cachepref=<xsl:value-of select="@cp"/> -p2ppref=<xsl:value-of select="@pp"/><xsl:if test="@section"> -section=<xsl:value-of select="@section"/></xsl:if>
psu add link <xsl:value-of select="@name"/>  <xsl:text> </xsl:text><xsl:value-of select="@pgroup"/>
</xsl:template>

<xsl:template match="linkGroup">
    <xsl:variable name="linkGroup" select="@name"/>
psu create linkGroup <xsl:value-of select="$linkGroup"/>
<xsl:for-each select="link">
psu addto linkGroup <xsl:value-of select="$linkGroup"/> <xsl:text> </xsl:text><xsl:value-of select="@name"/>
</xsl:for-each>
psu set linkGroup custodialAllowed <xsl:value-of select="$linkGroup"/> <xsl:text> </xsl:text> <xsl:value-of select="@custodial"/>
psu set linkGroup replicaAllowed <xsl:value-of select="$linkGroup"/> <xsl:text> </xsl:text> <xsl:value-of select="@replica"/>
psu set linkGroup nearlineAllowed <xsl:value-of select="$linkGroup"/> <xsl:text> </xsl:text> <xsl:value-of select="@nearline"/>
psu set linkGroup onlineAllowed <xsl:value-of select="$linkGroup"/> <xsl:text> </xsl:text> <xsl:value-of select="@online"/>
psu set linkGroup outputAllowed <xsl:value-of select="$linkGroup"/> <xsl:text> </xsl:text> <xsl:value-of select="@output"/><xsl:text>
</xsl:text>

</xsl:template>


</xsl:stylesheet>