Commit bf86cec2 authored by Vitaly Lipatov's avatar Vitaly Lipatov

update gluster utils

parent a684053f
......@@ -63,7 +63,7 @@ get_volume()
get_bricks()
{
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()
......@@ -110,7 +110,7 @@ opbrick()
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()
......@@ -264,9 +264,10 @@ get_gfid()
[ -n "$host" ] || return
#trusted.gfid=0x9dd12f564daa42ff94e103a4b0fb0899
# /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 [ -n "$gfid" ] ; then
echo "gfid='$gfid'" >&2
python -c "import uuid; x=uuid.UUID(hex='$gfid'); print x;"
fi
}
......@@ -288,6 +289,7 @@ fi
echo
echo "mounted info for $sfile:"
if [ -z "$restore" ] ; then
echo "md5sum $sfile"
md5sum "$sfile"
fi
......@@ -308,12 +310,13 @@ fi
# hack: translate to a path on volume
file="$(echo "$sfile" | sed -e "s|$FTPROOT/||g")"
echo "Volume path: $file, LISTBRICKS: $LISTBRICKS"
# hack
FLAGSYMLINK=
[ -L "$sfile" ] && FLAGSYMLINK=1
stat "$sfile"
#stat "$sfile"
if [ -z "$restore$remove" ] ; then
for brick in $LISTBRICKS ; do
......@@ -331,7 +334,7 @@ for brick in $LISTBRICKS ; do
#trusted.gfid=0x9dd12f564daa42ff94e103a4b0fb0899
# /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 [ -n "$gfid" ] ; then
gfid=`python -c "import uuid; x=uuid.UUID(hex='$gfid'); print x;"`
......
#!/bin/bash
# TODO
# деление должно происходить не по пользователям компьютеров, а по тому, есть ли на них gluster-сервер
# hosts - машины в пуле glusterd (используется glusterfsX-server)
# clients - машины НЕ в пуле (не используется glusterfsX-server)
personal="snail lin-test nun lav asu multi"
servers="server arbiter cellar windsor space1 vbox"
#No 32-bit:
#personal="snail lin-test lav"
#servers="windsor vbox space1"
hosts="$personal $servers"
clients="ant builder64 download"
# builder builder64"
hosts="arbiter space1 virtualbox lin-test snail lav nun download cellar windsor"
clients="ant builder64 localhost statos"
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