Commit bf86cec2 authored by Vitaly Lipatov's avatar Vitaly Lipatov

update gluster utils

parent a684053f
...@@ -63,7 +63,7 @@ get_volume() ...@@ -63,7 +63,7 @@ get_volume()
get_bricks() get_bricks()
{ {
local GVOLUME="$1" local GVOLUME="$1"
gluster volume info $GVOLUME | grep Brick"[0-9]" | sed -e "s|Brick[0-9]: ||g" | sed -e "s|.(.*||g" | grep -v "arbiter" ssh hektor gluster volume info $GVOLUME | grep Brick"[0-9]" | sed -e "s|Brick[0-9]: ||g" | sed -e "s|.(.*||g" #| grep -v "arbiter"
} }
set_host_path() set_host_path()
...@@ -110,7 +110,7 @@ opbrick() ...@@ -110,7 +110,7 @@ opbrick()
fastssh() fastssh()
{ {
ssh -o "ControlMaster auto" -o "ControlPath ~/tmp/ssh_mux_%h_%p_%r" -o "ControlPersist 4h" "$@" ssh -x -o "ControlMaster auto" -o "ControlPath ~/tmp/ssh_mux_%h_%p_%r" -o "ControlPersist 4h" "$@"
} }
sshopbrick() sshopbrick()
...@@ -264,9 +264,10 @@ get_gfid() ...@@ -264,9 +264,10 @@ get_gfid()
[ -n "$host" ] || return [ -n "$host" ] || return
#trusted.gfid=0x9dd12f564daa42ff94e103a4b0fb0899 #trusted.gfid=0x9dd12f564daa42ff94e103a4b0fb0899
# /var/local/eterglust/pub/.glusterfs/9d/d1/9dd12f56-4daa-42ff-94e1-03a4b0fb0899 # /var/local/eterglust/pub/.glusterfs/9d/d1/9dd12f56-4daa-42ff-94e1-03a4b0fb0899
gfid=$(sshopbrick "getfattr -h -d -m . -e hex" "$file" | grep ^trusted.gfid=0x | sed -e "s|trusted.gfid=0x||g") gfid=$(sshopbrick "getfattr -h -d -m . -e hex" "$file" | grep "^trusted\.gfid=0x" | sed -e "s|trusted.gfid=0x||g")
# if file exists, really # if file exists, really
if [ -n "$gfid" ] ; then if [ -n "$gfid" ] ; then
echo "gfid='$gfid'" >&2
python -c "import uuid; x=uuid.UUID(hex='$gfid'); print x;" python -c "import uuid; x=uuid.UUID(hex='$gfid'); print x;"
fi fi
} }
...@@ -288,6 +289,7 @@ fi ...@@ -288,6 +289,7 @@ fi
echo echo
echo "mounted info for $sfile:" echo "mounted info for $sfile:"
if [ -z "$restore" ] ; then if [ -z "$restore" ] ; then
echo "md5sum $sfile"
md5sum "$sfile" md5sum "$sfile"
fi fi
...@@ -308,12 +310,13 @@ fi ...@@ -308,12 +310,13 @@ fi
# hack: translate to a path on volume # hack: translate to a path on volume
file="$(echo "$sfile" | sed -e "s|$FTPROOT/||g")" file="$(echo "$sfile" | sed -e "s|$FTPROOT/||g")"
echo "Volume path: $file, LISTBRICKS: $LISTBRICKS"
# hack # hack
FLAGSYMLINK= FLAGSYMLINK=
[ -L "$sfile" ] && FLAGSYMLINK=1 [ -L "$sfile" ] && FLAGSYMLINK=1
stat "$sfile" #stat "$sfile"
if [ -z "$restore$remove" ] ; then if [ -z "$restore$remove" ] ; then
for brick in $LISTBRICKS ; do for brick in $LISTBRICKS ; do
...@@ -331,7 +334,7 @@ for brick in $LISTBRICKS ; do ...@@ -331,7 +334,7 @@ for brick in $LISTBRICKS ; do
#trusted.gfid=0x9dd12f564daa42ff94e103a4b0fb0899 #trusted.gfid=0x9dd12f564daa42ff94e103a4b0fb0899
# /var/local/eterglust/pub/.glusterfs/9d/d1/9dd12f56-4daa-42ff-94e1-03a4b0fb0899 # /var/local/eterglust/pub/.glusterfs/9d/d1/9dd12f56-4daa-42ff-94e1-03a4b0fb0899
gfid=$(cat $WORKDIR/getfattr | grep ^trusted.gfid | sed -e "s|trusted.gfid=0x||g") gfid=$(cat $WORKDIR/getfattr | grep "^trusted\.gfid=0x" | sed -e "s|trusted.gfid=0x||g")
# if file exists, really # if file exists, really
if [ -n "$gfid" ] ; then if [ -n "$gfid" ] ; then
gfid=`python -c "import uuid; x=uuid.UUID(hex='$gfid'); print x;"` gfid=`python -c "import uuid; x=uuid.UUID(hex='$gfid'); print x;"`
......
#!/bin/bash #!/bin/bash
# TODO # hosts - машины в пуле glusterd (используется glusterfsX-server)
# деление должно происходить не по пользователям компьютеров, а по тому, есть ли на них gluster-сервер # clients - машины НЕ в пуле (не используется glusterfsX-server)
personal="snail lin-test nun lav asu multi" hosts="arbiter space1 virtualbox lin-test snail lav nun download cellar windsor"
servers="server arbiter cellar windsor space1 vbox" clients="ant builder64 localhost statos"
#No 32-bit:
#personal="snail lin-test lav"
#servers="windsor vbox space1"
hosts="$personal $servers"
clients="ant builder64 download"
# builder builder64"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment