data:Dcache/195/server
See also troubleshooting for this page.
Contents |
dCache server v1.9.5
Prepare
- Operating system
- Scientific Linux v.5.4 64 bit
Optimizing the configuration:
Use minimal operating system installation without firewall. To verify installed packages use the command
-
rpm -qa | grep package_name
Install the following additional packages:
-
yum -y install wget yum rpm make gcc gcc-c++ tar sed zlib openssl
After the installation is complete, turn off any unnecessary services (like gpm, sendmail, cups, haldaemon, messagebus, pcmcia, anacron, atd) with the following command:
-
chkconfig <SERVICE> off
Configure the following settings for the server:
- proxy
- ntp
- script:/etc/resolv.conf
- java SDK >= 1.6
- PostgreSQL version >= 8
- Configure users: postgres and srmdcache
- The host running the srm transfer service needs to have a host certificate and a host key in place (/etc/grid-security/hostcert.pem, /etc/grid-security/hostkey.pem).
- Firewall configuration
dCache ports (additionally see dCache book, chapter 22)
| Protocol | Port(s) | Direction | Nodes |
|---|---|---|---|
| dCap | 22125 | incoming | doorDomain (admin node) |
| any | outgoing | pools | |
| GSIdCap | 22128 | incoming | gsidcapDomain (where GSIDCAP=yes in node_config) |
| any | outgoing | pools | |
| GridFTP | 2811 | incoming | gridftpDomain (where GRIDFTP=yes in node_config) |
| 20000-25000 | outgoing (active FTP) | pools | |
| 20000-25000 | incoming (passive FTP) | gridftpDomain | |
| SRM v1 | 8443 | incoming | srmDomain |
| SRM v2 | 8444 | incoming | srmDomain |
There are two ways to configure the Firewall ports:
- Before dcache setup. Firewall ports can be configured by the
site-info.defvariables:- DCACHE_PORT_RANGE_PROTOCOLS_SERVER_GSIFTP. Sets the portrange for dcache as a GSIFTP server in "passive" mode. Default value is from 50000 till 52000 ("50000,52000").
- DCACHE_PORT_RANGE_PROTOCOLS_CLIENT_GSIFTP. Sets the portrange for dcache as a GSIFTP client in "active" mode. Default value is from 33115 till 33125 ("33115,33125").
- DCACHE_PORT_RANGE_PROTOCOLS_SERVER_MISC. Sets the portrange for dcache as a (GSI)DCAP and xrootd server in "passive" mode. Default value is from 60000 till 62000 ("60000,62000").
- After dcache setup. Modify the following variables into
/opt/d-cache/config/dCacheSetup-
Java Configurationsection-
Dorg.globus.tcp.port.rangeto "20000,25000" -
Dorg.dcache.net.tcp.portrangeto "33115,33215"
-
-
Network Configurationsection-
dCapPortto "22125" -
dCapGsiPortto "22128" -
gsiFtpPortNumberto "2811" -
srmPortto "8443" -
clientDataPortRangeto "20000,25000"
-
-
administrator's script: prepare.sh
#!/bin/bash# prepare to install dcache server# Declare the variables section ------------# Please insert your actual configuration# The two users '''edguser''' and '''edginfo''' must be added on information provider nodes# They are not needed on other nodes but, since their presence will do no harm, they may be# added on all nodes.# EDGUSER=edguser# EDGINFO=edginfo# from here ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~EDGUSER=edguserEDGINFO=edginfoJAVA_PATH=/usr/java/latest
# till here ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#-> start routineadduser -r -s /bin/false -d /localhome/edg $EDGUSER
adduser -r -s /bin/false -d /localhome/edg $EDGINFO
# clean all for yum to remove unnecessary configurationsyum clean all# install prerequisites:yum -y install jdk.x86_64 java-1.6.0-sun-compat.x86_64
yum -y install postgresql postgresql-libs postgresql-server
yum update --exclude *kernel*
export JAVA_HOME=$JAVA_PATH
export PATH=$JAVA_HOME/bin/:$PATH
echo "
# TYPE DATABASE USER CIDR-ADDRESS METHOD# \"local\" is for Unix domain socket connections onlylocal all all trust# IPv4 local connections:host all all 0.0.0.0 0.0.0.0 trust# IPv6 local connections:host all all ::1/128 trust" > /var/lib/pgsql/data/pg_hba.conf
# run dbms server and initialize db/etc/init.d/postgresql restart
chkconfig postgresql on
# create 'postgres' and 'srmdcache' userssu - postgrescreateuser -U srmdcache --no-superuser --no-createrole --createdb --pwprompt srmdcache
# <type in "srmdcache" as password two times>createdb -U srmdcache dcache#<- end routine
Install
WARNING: Users edguser and edginfo must be added into the information provider nodes (in general this is considered to be the "admin node"). They are not needed on other nodes but, since their presence will do no harm, they may be added on all nodes.
Users postgres and (after PostgresSQL is installed) srmdcache to connect dCache to the databases should be created. They need other rights for handling PostgreSQL databases like a normal unix user, therefore use PostgreSQL tools with the option -U to allow execution of commands with a different user account.
Install dCache server and clients
- dcache-server
- dcap
- libdcap
- dcache-srmclient
administrator's script: install.sh
#!/bin/bash# install dcache scriptsu -BASE_URL=http://mirror.scc.kit.edu/downloads/rpms/dcache
# install dCache server and clientsrpm -Uhv ${BASE_URL}/2010.1/dcache-server-1.9.5-10.noarch.rpm
rpm -Uhv ${BASE_URL}/2010.1/dcache-srmclient-1.9.5-3.noarch.rpm
rpm -Uhv ${BASE_URL}/2010.1/dcap-1.9.3-7.x86_64.rpm
rpm -Uhv ${BASE_URL}/2010.1/libdcap-1.9.3-7.x86_64.rpm
Configure
node_config
Edit the file node_config and place it inside of /opt/d-cache/etc.
| A template is shipped together with the dCache server rpm and can be found at /opt/d-cache/etc/node_config.template. Look into the template for some documentation. |
This flat file defines few, node-specific variables that are needed on all nodes the dCache setup consists of. The following values have to be set in the node_config file:
| NAMESPACE=chimera | Defines the type of namespace dCache will use. Possible values are pnfs or chimera. |
| NAMESPACE_NODE=<FQDN of your headnode> | Defines the (fully qualified domain) name of the node that hosts the dCache service for managing the namespace. |
| NODE_TYPE=admin | Defines the role this node has to fulfill in the global dCache setup. Set this either to admin, so a predefined set of services will be launched on this host, or custom and select every single service by means of the next variable. |
| SERVICES="srm dcap gsidcap gridftp info" | List all services that this node should host. Possible values can be chosen from dcap, gsidcap, srm, gridftp, xrootd, info, gPlazma, chimera, admin, httpd, utility, dir, statistics, lm, dCache, replica. |
dCacheSetup
The next important file for configuration is the dCacheSetup file. Again we have to edit some variables inside of it and place it afterwards at /opt/d-cache/config/dCacheSetup.
| dCache comes with a template of the dCacheSetup file, too. It can be found at /opt/d-cache/etc/dCacheSetup.template. |
In the dCacheSetup file almost all variables are of global importance. Hence, it is strictly advised to keep this file as much identical as possible among all nodes of the dCache setup (it will ease the administration a lot!). Set the following values inside of it:
| serviceLocatorHost=<FQDN of your headnode> | Adjust this to point to one unique server for one and only one dCache instance (usually the admin node). |
| java="/usr/java/latest/bin/java" | Set this to the jdk executable you want to use for dCache. |
| java_options="-server -Xmx64m -XX:MaxDirectMemorySize=64m (...)" | The numbers for Xmx and MaxDirectMemorySize indicate the amount of memory allocated for each java task initialized by dCache. |
| cacheInfo=pnfs | dCache needs to know about locations for all stored files. This variable decides whether this information is kept in a separate database or the namespace service itself. Usually pnfs is chosen if Chimera is used and companion otherwise. |
| logArea=/var/log/dCache | In principle dCache can write its log files in any existing directory. But as every dCache service has its own log file, thus the number may become high, it may turn out beneficial to separate them from the default system log files. |
Chimera
- As user postgres create a database for Chimera, the namespace type of our choice.
- The Chimera NFS server uses the /etc/exports file to manage exports. A typical export file looks like:
/ localhost(rw) /pnfs *.your.domain(rw)
| Probably such a file does not exist yet. Then it has to be created. |
- After you have edited /etc/exports, start the NFS server via script:
/opt/d-cache/libexec/chimera/chimera-nfs-run.sh start
- Create the main Chimera path
| In the production system mount localhost:/pnfs /pnfs can be used. But for configuration/initialization mount localhost:/ /mnt is needed. |
- Create the root of the Chimera namespace, called pnfs (for legacy reasons).
- Add the directory tags "sGroup", "OSMTemplate", "RetentionPolicy", "AccessLatency".
| Directory tags in PNFS are metadata, which will be evaluated by dCache and inherited by future subdirectories. |
| The Chimera configuration is done now, so unmount NFSv3: umount /mnt Whenever you need to change the configuration, you have to remount the admin-view (localhost:/) to a temporary location like /mnt |
- Create directories for storing data as needed. Remember to adapt the owners for the directories accordingly (the directories should not be owned by root)! For this, have a look at attribute-based authorization in dCache.
Miscellaneous tasks
- Create the directory for dCache to put it's logfiles in, if it does not exist yet (remember the settings from the dCacheSetup file).
- Normally every dCache component has its own logfile which will be stored in this directory. But all current dCache versions have one exception to this rule: /opt/d-cache/libexec/apache-tomcat-5.5.20/logs/catalina.out. This file is used as logfile for the SRM-Domain. If you like to work with this logfile as with every other dCache logfile, than you may consider to install a symbolic link:
ln -s /opt/d-cache/libexec/apache-tomcat-5.5.20/logs/catalina.out /var/log/dCache/srm-dgiref-dcacheDomain.log
- Create a little wrapper for the dccp command which sets the environment variable LD_LIBRARY_PATH whenever executed.
- Once all this configuration is done, we have to make it take effect by running /opt/d-cache/install/install.sh
| Everytime basic settings – e.g. there has been an update of the dCache version – have changed, install.sh must be executed! |
- Configure dCache pools
| dCache pools hold all the data ever written into dCache. These pools are completely independent from the PNFS directories (for the time beeing). In fact, they could be created anywhere and then mounted locally. Do not use the whole disk space available for the pools! dCache needs some additional space to keep record on metadata linked to files stored in each pool. |
- The (logical) dCache pools are created by means of /opt/d-cache/bin/dcache pool create <size> <target location>.
- Add pools to a dCache domain (usage: /opt/d-cache/bin/dcache pool add [--fqdn] [--domain=<domain>] [--lfs=<mode>] <pool name> <target location>). If no domain is specified, the pool will be added to one named after the hostname (in our case "dgiref-dcache.fkz.deDomain"). "lfs=precious" makes a pool disk-only, that is without HSM back-end.
- Adapt the file /opt/d-cache/config/PoolManager.conf.
administrator's script: configure.sh
#!/bin/sh#headNode=<FQDN of your headnode>#domainName=fzk.deheadNode=dgiref-dcache.fzk.dedomainName=fzk.de# node_configcp /opt/d-cache/etc/node_config.template /opt/d-cache/etc/node_config
# NAMESPACE=chimera# NAMESPACE_NODE=$headNode# NODE_TYPE=admin# SERVICES="srm dcap gsidcap gridftp info"# dCacheSetupcp /opt/d-cache/etc/dCacheSetup.template /opt/d-cache/config/dCacheSetup
# serviceLocatorHost=$headNode# java="/usr/java/latest/bin/java"# java_options="-server -Xmx64m -XX MaxDirectMemorySize=64m (...)"# cacheInfo=pnfs# logArea=/var/log/dCache# configure Chimeracreatedb -U postgres chimerapsql -U postgres chimera < /opt/d-cache/libexec/chimera/sql/create.sql
createlang -U postgres plpgsql chimerapsql -U postgres chimera < /opt/d-cache/libexec/chimera/sql/pgsql-procedures.sql
# exportecho "\
/ localhost(rw)
/pnfs *.$domainName(rw)" > /etc/exports
mkdir /var/log/dCache
touch /var/log/dCache/chimera-nfsv3.log
# start NFS server/opt/d-cache/libexec/chimera/chimera-nfs-run.sh start
# Starting Chimera-NFSv3 interface# Waiting for NFS server to register itself: ....# setup on bootln -s /opt/d-cache/libexec/chimera/chimera-nfs-run.sh /etc/init.d/chimera-nfs-run
chkconfig --add chimera-nfs-runchkconfig chimera-nfs-run on
# mountmkdir /pnfs
mount localhost:/ /mnt
# create the structuremkdir -p /mnt/pnfs/$domainName # root of the Chimera namespace
mkdir -p /mnt/pnfs/$domainName/data #
echo "chimera" > /mnt/pnfs/$domainName/data/'.(tag)(sGroup)'
echo "StoreName chimera" > /mnt/pnfs/$domainName/data/'.(tag)(OSMTemplate)'
echo "REPLICA" > /mnt/pnfs/$domainName/data/'.(tag)(RetentionPolicy)'
echo "ONLINE" > /mnt/pnfs/$domainName/data/'.(tag)(AccessLatency)'
umount /mnt
mount localhost:/pnfs /pnfs
# Miscellaneous tasksecho "\
#!/bin/sh
LD_LIBRARY_PATH=/opt/d-cache/dcap/lib /opt/d-cache/dcap/bin/dccp \"\$@\"" > /usr/local/bin/dccp
chmod +x /usr/local/bin/dccp
/opt/d-cache/install/install.sh
#INFO:installing config for startup/shutdown script#INFO:Installation complete#INFO:please use /opt/d-cache/bin/dcache start|stop|restart srm to startup, shutdown or restart srm server# Configure dCache poolsmkdir /pools
/opt/d-cache/bin/dcache pool create 1G /pools/pool1
/opt/d-cache/bin/dcache pool create 1G /pools/pool2
/opt/d-cache/bin/dcache pool add --domain=pool1Domain --lfs=precious pool1 /pools/pool1
/opt/d-cache/bin/dcache pool add --domain=pool2Domain --lfs=precious pool2 /pools/pool2
#The pool will not be operational until the domain has been started. Use#'start pool1Domain' to start the pool domain.mkdir /pnfs/$domainName/data/disk-only
# /opt/d-cache/config/PoolManager.conf# configure section: The pools# configure section: The pool groups# configure section: The link groups# Authorization
Proceed
- make dCache a known service so it will be started during boot phase.
- start dCache as a service
Starting lmDomain Done (pid=19164) Starting dCacheDomain Done (pid=19233) Starting dirDomain Done (pid=19305) Starting adminDoorDomain Done (pid=19389) Starting httpdDomain Done (pid=19477) Starting utilityDomain 6 Done (pid=19560) Starting gPlazma-dgiref-dcacheDomain 6 Done (pid=19712) Starting chimeraDomain 6 Done (pid=19800) Starting pool1Domain Done (pid=19900) Starting pool2Domain Done (pid=19987) Starting infoProviderDomain Done (pid=20083) Starting infoDomain Done (pid=20163) statisticsDomain might still be running Starting dcap-dgiref-dcacheDomain Done (pid=20335) Starting gridftp-dgiref-dcacheDomain 6 Done (pid=20460) Starting gsidcap-dgiref-dcacheDomain Done (pid=20621) Using CATALINA_BASE: /opt/d-cache/libexec/apache-tomcat-5.5.20 Using CATALINA_HOME: /opt/d-cache/libexec/apache-tomcat-5.5.20 Using CATALINA_TMPDIR: /opt/d-cache/libexec/apache-tomcat-5.5.20/temp Using JRE_HOME: /usr/java/jdk1.6.0_17 Pinging srm server to wake it up, will take few seconds ... VersionInfo : v2.2 backend_type:dCache Done |
administrator's script: proceed.sh
#!/bin/sh# start/stop dcache server# make dCache a known service so it will be started during boot phase.ln -s /opt/d-cache/bin/dcache /etc/init.d/dcache
chkconfig --add dcachechkconfig dcache on
# start dCache:service dcache start
Initial test
- check dCache web interface on the dcache server port 2288 (http://<dcache-headnode-fqdn>:2288/cellinfo)
- write a file via dccp (so unauthenticated)
- write a file via srmcp (using a voms-proxy)
Additional information can be used from the Troubleshooting.
administrator's script: test.sh
#!/bin/bash# test# accessing file system with standard commandsls /pnfs/fzk.de/data/dgtest/
touch /pnfs/fzk.de/data/dgtest/test.blub
rm /pnfs/fzk.de/data/dgtest/test.blub
# copying data using dCache protocolsdccp /bin/bash gsidcap://dgiref-dcache.fzk.de:22128/pnfs/fzk.de/data/dgtest/testbin-1
# delete data with srmrmsrmrm srm://dgiref-dcache.fzk.de:8443/pnfs/fzk.de/data/dgtest/testbin-1
Update
To update/remove the dCache server do:
- Get the dCache rpms for the version you want to install
- Remember to read the changelog for the version and adapt the following steps accordingly
- Stop all running dCache services
- Install the rpms
- Run /opt/d-cache/install/install.sh
- Restart dCache services
administrator's script: update.sh
#!/bin/bash# update dcache serverservice dcache stop
# Install new version rpms# after new packages installation run/opt/d-cache/install/install.sh
service dcache restart