summaryrefslogtreecommitdiffstats
path: root/extras/scale-n-defrag.sh
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-07-14 13:58:20 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-07-14 14:44:26 -0700
commit654a720eed0bc5faaeeaa4eb34f1cfc10df76230 (patch)
treeb84419d192c46e39a40b7a3133666ddde453aba2 /extras/scale-n-defrag.sh
parente73a856e926465068f6f6cf5a0cace501589957c (diff)
proper way to do defrag of a mountpoint
Usage: "glusterfs-defrag <MOUNTPOINT>" there are new features added to distribute with this patch: * bash# getfattr -n trusted.distribute.linkinfo <file> Gives output in the format "<hostname>:<directory>", if there is a linkfile present, where hostname is server, directory is backend directory where the actual linkfile is present. * bash# getfattr -n trusted.glusterfs.pathinfo <path> Gives layout information if directory, and info about actual location of file in backend servers, in the form of 'hostname:directory'. (TODO: should extend it to all xlators) * bash# getfattr -n trusted.distribute.fix.layout <path> scales out the directory layout in distribute, so when new servers are added, layouts are fixed to include them. * removed 'scale-n-defrag.sh' as its no more required. * changed 'defrag.sh' to have a feature to specify target bricks, so defrag happens to only those nodes. moved the file to 'glusterfs-defrag', which now gets installed to '${prefix}/bin' * storage/posix: takes new option 'hostname' so it can resolve to same hostname given during 'gluster volume create'. with 'trusted.glusterfs.pathinfo' posix returns the value in 'hostname:real_path' format. Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1073 ('gluster defrag <VOLNAME>' fails in mainline) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1073
Diffstat (limited to 'extras/scale-n-defrag.sh')
-rw-r--r--extras/scale-n-defrag.sh37
1 files changed, 0 insertions, 37 deletions
diff --git a/extras/scale-n-defrag.sh b/extras/scale-n-defrag.sh
deleted file mode 100644
index 1031b3931a8..00000000000
--- a/extras/scale-n-defrag.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-
-# This script runs over the GlusterFS mountpoint (from just one client)
-# to handle the distribution of 'data', after the distribute translator's
-# subvolumes count changes.
-#
-# (c) 2009 Gluster Inc, <http://www.gluster.com/>
-#
-#
-# Make sure the following variables are properly initialized
-
-MOUNTPOINT=/tmp/testdir
-directory_to_be_scaled="${MOUNTPOINT}/"
-
-logdir=$(dirname $0)
-cd $logdir
-LOGDIR=$(pwd)
-cd -
-
-# The below command is enough to make sure the new layout will be scaled across new
-# nodes.
-find ${directory_to_be_scaled} -type d -exec setfattr -x "trusted.glusterfs.dht" {} \;
-
-# Now do a lookup on files so the scaling/re-hashing is done
-find ${directory_to_be_scaled} > /dev/null
-
-
-# copy the defrag (to copy data across for new nodes (for linkfiles))
-#
-
-
-cd ${directory_to_be_scaled};
-for dir in *; do
- echo "Defragmenting directory ${directory_to_be_scaled}/$dir ($LOGDIR/defrag-store-$dir.log)"
- $LOGDIR/defrag.sh $dir >> $LOGDIR/defrag-store-$dir.log 2>&1
- echo Completed directory ${directory_to_be_scaled}/$dir
-done