How to Move data from pool to pool (how to drain a pool)
usecase:
we want to retire the node c-2-33 from the pool nodes..so we need to move the data from pool c-2-33_1(physically
the data are stored under /dcache/pool/data directory ,we can see the total size is about 135G) to other available pools.
One way we could use is the
CopyManager Cell provided by the latest dcache..
but there is a limitation about the
CopyManager,you should make sure the destination pool has enough space to store
the files moved from the source pool..As
CopyManager can only move files from a pool to another pool,but can not
distribut files to a set of pools.
1 we can check on the web monitor http://head01.aglt2.org:2288/usageInfo ,to see which pool could be used as the destination pool. in this case, we choose pool c-2-32_1 which has enough free space (about 1TB) to hold the source files.
a) make up a copy.batch file in the dir /opt/d-cache/config..its content can be as follows:
root@head01 ~# more /opt/d-cache/config/copy.batch
#
set printout default 3
set printout CellGlue none
onerror shutdown
#
check -strong setupFile
#
copy file:${setupFile} context:setupContext
#
# import the variables into our $context.
# don't overwrite already existing variables.
#
import context -c setupContext
#
# Make sure we got what we need.
#
check -strong serviceLocatorHost serviceLocatorPort
#
create dmg.cells.services.RoutingManager RoutingMgr
#
# The LocationManager Part
#
create dmg.cells.services.LocationManager lm \
"${serviceLocatorHost} ${serviceLocatorPort} "
#
#
#
create diskCacheV111.replicaManager.CopyManager copy0 \
"default -export"
#
create diskCacheV111.replicaManager.CopyManager copy1 \
"default -export"
#
create diskCacheV111.replicaManager.CopyManager copy2 \
"default -export"
#
b) run /opt/d-cache/jobs/initPackage.sh to generate the copy scripts in jobs dir.
root@head01 /opt/d-cache/jobs# ./initPackage.sh
Checking MasterSetup ./config/dCacheSetup O.k.
Scanning dCache batch files
Processing adminDoor
Processing copy
Processing dCache
Processing dir
Processing door
Processing gPlazma
Processing gridftpdoor
Processing gsidcapdoor
Processing httpd
Processing infoProvider
Processing lm
Processing pnfs
Processing pool
Processing replica
Processing srm
Processing statistics
Processing utility
Processing xrootdDoor
Checking Users database .... Ok
Checking Security .... Ok
Checking JVM ........ Ok
Checking Cells ...... Ok
dCacheVersion ....... Version production-1-7-0-38
root@head01 ~# /opt/d-cache/jobs/copy start
4 check the logfile of copymanager to see if there are any errors
root@head01 ~# tail /var/log/copyDomain.log
5 login the admin interface to move the data:
head01 ~# ssh -l admin -c blowfish -p 22223 localhost
admin@localhost's password:
dCache Admin (VII) (user=admin)
(local) admin >
(local) admin > cd c-2-32_1 # change to the destination pool cell
(c-2-32_1) admin > pp set pnfs timeout 300 #set the pnfs timeout
(c-2-32_1) admin > save
(c-2-32_1) admin > ..
(local) admin > cd c-2-33_1 #change to the source pool cell
(c-2-33_1) admin > p2p set max active 10 #set max active number
(c-2-33_1) admin > mover ls #check if there are any mover running
(c-2-33_1) admin > pp ls #check if there are any transfers
(c-2-33_1) admin > ..
(local) admin > cd copy0 #change to the copymanager cell,the name is correspondding to the one you specified in your copy.batch file
(copy0) admin > copy c-2-33_1 c-2-32_1 -max=5 #copy data from source pool to destination pool
(copy0) admin > info #check the process of data moving.
Name : copy0
Class : diskCacheV111.replicaManager.CopyManager
Version : $Id: CopyManager.java,v 1.4 2005/10/03 21:45:00 patrick Exp $
Mode : ACTIVE
Status : Processing 2134 files
Transfer : c-2-33_1 -> c-2-32_1
Started : Thu Sep 20 16:55:15 EDT 2007
Param : Progress(f,b)=1,7346639;Failed(f,b)=0,0;Active(c,m)=5,5
Progress
+----------------------------------------+
| | 0 %
+----------------------------------------+
Average Speed : 3.0515246 MBytes/second
(copy0) admin > info
Name : copy0
Class : diskCacheV111.replicaManager.CopyManager
Version : $Id: CopyManager.java,v 1.4 2005/10/03 21:45:00 patrick Exp $
Mode : IDLE
Status : Done with 2134 files
Transfer : c-2-33_1 -> c-2-32_1
Started : Thu Sep 20 16:55:15 EDT 2007
Finished : Thu Sep 20 18:54:11 EDT 2007
Param : Progress(f,b)=2134,143715233259;Failed(f,b)=0,0;Active(c,m)=0,5
Progress
+----------------------------------------+
|****************************************| 100 %
+----------------------------------------+
Average Speed : 19.206345 MBytes/second
now it is finished.
6 .check the destination pool
root@c-2-32 /dcache/pool/data# ll |wc -l
2142
which ,before the copy process,I checked the file in this dir,it is
root@c-2-32 /dcache/pool/data# ll |wc -l
8
it means all the files have been copied from pool c-2-33_1 to pool c-2-32_1..it has nothing to do
with the replicas count.It does a complete pool to pool copy..
7 .remove the file on pool c-2-33_1 as you wish..
references:
https://twiki.grid.iu.edu/twiki/bin/view/Storage/DcacheWorkshop
http://www.dcache.org/manuals/experts_docs/Resilient_dCache_v1_0.html
http://t2.unl.edu/documentation/dcache_replicas
--
WenjingWu - 21 Sep 2007