Installation of dCache on fresh installed VM.
To run dCache you need Java JRE and PostgreSQL.
yum update
Search for java and PostgreSQL
yum search jdk |grep sun yum search postgresql |grep server
Install java (here java-1.6.0-sun-compat.i586) and PostgreSQL (here postgresql-server.i386)
yum install java-1.6.0-sun-compat.i586 yum install postgresql-server.i386
Start PostgreSQL
/etc/init.d/postgresql start
For PostgreSQL 9.0
/etc/init.d/postgresql-9.0 initdb /etc/init.d/postgresql-9.0 start
Make sure that postgresql will be started automatically after booting.
chkconfig postgresql on
For PostgreSQL 9.0
chkconfig postgresql-9.0 on
Find the link location of the dCache you want to install, e.g. on Hudson for 1.9.10
http://svn.dcache.org/build/job/dCache-1.9.10/lastSuccessfulBuild/artifact/1.9.10/dist/noarch/dcache-server-1.9.10-r14661.noarch.rpm
rpm -ivh http://svn.dcache.org/build/job/dCache-1.9.10/lastSuccessfulBuild/artifact/1.9.10/dist/noarch/dcache-server-1.9.10-r14661.noarch.rpm
Configure the PostgreSQ? server (change 'ident sameuser' to 'trust')
vi /var/lib/pgsql/data/pg_hba.conf
For PostgreSQL 9.0
vi /var/lib/pgsql/9.0/data/pg_hba.conf
Restart PostgreSQL
/etc/init.d/postgresql restart
For PostgreSQL 9.0
/etc/init.d/postgresql-9.0 restart
Configure Chimera
createdb -U postgres chimera createuser -U postgres --no-superuser --no-createrole --createdb --pwprompt chimera psql -U chimera chimera -f /opt/d-cache/libexec/chimera/sql/create.sql createlang -U postgres plpgsql chimera psql -U chimera chimera -f /opt/d-cache/libexec/chimera/sql/pgsql-procedures.sql
Edit /opt/d-cache/config/chimera-config.xml and set user=chimera
vi /opt/d-cache/config/chimera-config.xml
Create exports file
echo -e "/ localhost(rw) /pnfs" > /etc/exports
Stop portmap
/etc/init.d/portmap stop
Create the root of the Chimera namespace (called pnfs) and add directory tags
/opt/d-cache/libexec/chimera/chimera-cli.sh Mkdir /pnfs /opt/d-cache/libexec/chimera/chimera-cli.sh Mkdir /pnfs/desy.de /opt/d-cache/libexec/chimera/chimera-cli.sh Mkdir /pnfs/desy.de/data echo "chimera" | /opt/d-cache/libexec/chimera/chimera-cli.sh Writetag /pnfs/desy.de/data sGroup echo "StoreName sql" | /opt/d-cache/libexec/chimera/chimera-cli.sh Writetag /pnfs/desy.de/data OSMTemplate
Create the user srmdcache, the DB 'dcache' for user 'srmdcache', the DB 'replicas' for user 'srmdcache',
createuser -U postgres --no-superuser --no-createrole --createdb --pwprompt srmdcache createdb -U srmdcache dcache createdb -U srmdcache replicas psql -U srmdcache replicas -f /opt/d-cache/etc/psql_install_replicas.sql
Start dCache
/opt/d-cache/bin/dcache start
Wait a minute or two and mount Chimera
mount localhost:/ /mnt
If mount does not work, stop dCache and start portmap again (might help).
If you want to use dCap with a mounted file system instead of the URL-syntax (e.g. dccp /pnfs/example.org/data/file1 /tmp/file1), you need to mount the root of Chimera locally and make the right settings for the 'doorHost' and the 'dCap Port'.
mount localhost:/ /mnt mkdir /mnt/admin/etc/config/dCache touch /mnt/admin/etc/config/dCache/dcache.conf touch /mnt/admin/etc/config/dCache/'.(fset)(dcache.conf)(io)(on)' echo "$doorHost:22125" > /mnt/admin/etc/config/dCache/dcache.conf umount /mnt
If dccp /bin/sh dcap://vm-dcache-test03/data/world-writable/test2 fails with error message
Failed to create a control line Failed to create a control line Failed open file in the dCache. Can't open destination file : Unable to connect to server System error: No route to host
then
chkconfig iptables off iptables -F
and try again, works, but
Command failed! Server error message for [1]: "CacheException(rc=10001;msg=No such file or directory /data/world-writable/test2)" (errno 10001). Command failed! Server error message for [2]: "No write pool available for <size=0;new=true;stored=false;sClass=<Unknown>:<Unknown>;cClass=-;hsm=osm;accessLatency=NEARLINE;retentionPolicy=CUSTODIAL;uid=18216;onerror=default;truncate=;alloc-size=735804;gid=1000;path=/data/world-writable/test2;timeout=-1;mode=0755;store=<Unknown>;group=<Unknown>;bfid=<Unknown>;> in the linkGroup [none]" (errno 20). Failed open file in the dCache. Can't open destination file : "No write pool available for <size=0;new=true;stored=false;sClass=<Unknown>:<Unknown>;cClass=-;hsm=osm;accessLatency=NEARLINE;retentionPolicy=CUSTODIAL;uid=18216;onerror=default;truncate=;alloc-size=735804;gid=1000;path=/data/world-writable/test2;timeout=-1;mode=0755;store=<Unknown>;group=<Unknown>;bfid=<Unknown>;> in the linkGroup [none]" System error: Input/output error
