Commit b9bcc469 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add new gluster scripts

parent c8df964b
#!/bin/sh
for i in "$@" ; do
rm -rfv "$i"
./grf --allremove --restore --force "$i"
done
#!/bin/sh -x
echo "$@"/* | xargs -n1 echo > $0.list
./grf --restore --list $0.list
......@@ -5,8 +5,5 @@ VOLUME=ftp-$RES
LOCALPATH=/var/ftp/$RES
[ -n "$1" ] && LOCALPATH="$1"
>$0.log
#find $LOCALPATH -type f -size 0 -perm 1000 >>$0.log
find $LOCALPATH -type f >>$0.log
./grf --restore --list $0.log
find $LOCALPATH -type d -print0 | xargs -0 -n1 ./grf-dir
#!/bin/sh
FORCEDIR=1 ./grf-all $(cat grf.redo.list)
#!/bin/sh
# Пока только для каталогов
sort -u <grf.redo.list >grf.redo.list.w && rm -f grf.redo.list || exit
for i in $(cat grf.redo.list.w) ; do
SH=$(echo $i | sed -e "s|/var/ftp/pub/||g")
[ -d "$i" ] && ./removeallzero $SH
done
./grf --restore --list grf.redo.list.w
rm -f grf.redo.list.w
......@@ -18,9 +18,15 @@ for GVOLUME in $LISTVOLUME ; do
done
}
# from all hosts
#f
for host in builder64 space1 ; do
ssh $host cat /var/log/glusterfs/var-ftp-pub.log >>/var/log/glusterfs/var-ftppub-pub.log
ssh $host truncate -c -s0 /var/log/glusterfs/var-ftp-pub.log
done
for GVOLUME in $LISTVOLUME ; do
./grflog $GVOLUME
cat grflog.task
./grf --restore --list grflog.task
done
......@@ -34,12 +34,12 @@ grep "attempting deletion of stale linkfile" $0.$VOLUME.sorted.log >$0.$VOLUME.s
cat $0.$VOLUME.stale.log | sed -e "s|.*: attempting deletion of stale linkfile \(.*\) on $VOLUME.*|$LOCALPATH\1|g" | sort -u >>$TASKFILE
# remote operation failed. Path:
echo >>$TASKFILE
echo "# remote operation failed" >>$TASKFILE
# 0-ftp-pub-client-3: remote operation failed. Path:
#grep "remote operation failed" $0.$VOLUME.sorted.log >$0.$VOLUME.remote.log
grep "remote operation failed" $GLUSTERLOG >$0.$VOLUME.remote.log
cat $0.$VOLUME.remote.log | sed -e "s|.*: remote operation failed. Path: \(.*\) (.*|$LOCALPATH\1|g" | sort -u >>$TASKFILE
#echo >>$TASKFILE
#echo "# remote operation failed" >>$TASKFILE
## 0-ftp-pub-client-3: remote operation failed. Path:
##grep "remote operation failed" $0.$VOLUME.sorted.log >$0.$VOLUME.remote.log
#grep "remote operation failed" $GLUSTERLOG >$0.$VOLUME.remote.log
#cat $0.$VOLUME.remote.log | sed -e "s|.*: remote operation failed. Path: \(.*\) (.*|$LOCALPATH\1|g" | sort -u >>$TASKFILE
# gfid differs on subvolume
echo >>$TASKFILE
......
......@@ -4,5 +4,5 @@ RES=pub
VOLUME=ftp-$RES
LOCALPATH=/var/ftp/$RES
gluster volume heal ftp-pub info | grep "^[</]" | sed -e "s|^|$LOCALPATH/|g" | sort -u >$0.log
gluster volume heal ftp-pub info split-brain | tee $0.raw.log | grep "^[</]" | sed -e "s|^|$LOCALPATH/|g" | sort -u >$0.log
ADPATH=$1
for i in pub pvt tmp ; do
#SIZE="-size 0"
GLDIR="/var/local/eterglust/pub /var/local/eterglust/pub2 /var/local/eterglust2/pub"
#for i in pub pvt tmp ; do
# -noleaf
./glruncmd "find /var/local/eterglust/pub/$ADPATH -type f -size 0 -perm 1000 -print0 | xargs -0 rm -v"
./glruncmd "find /var/local/eterglust2/pub/$ADPATH -type f -size 0 -perm 1000 -print0 | xargs -0 rm -v"
done
for tr in $GLDIR ; do
./glruncmd "find $tr/$ADPATH -type f $SIZE -perm 1000 -print0 | xargs -0 -r rm -vf"
done
#done
#!/bin/sh
find /var/ftp -noleaf -print0 | xargs --null stat -t 2>>/var/log/glusterfs/triggering-selfheal.log
# https://access.redhat.com/documentation/en-US/Red_Hat_Storage/2.0/html/Administration_Guide/sect-User_Guide-Managing_Volumes-Self_heal.html
find /var/ftp$1 -noleaf -print0 | xargs --no-run-if-empty --null stat -t 2>>/var/log/glusterfs/triggering-selfheal.log
#!/bin/sh
sed -e "s|.*«\(.*\)».*|\1|g" </var/log/glusterfs/triggering-selfheal.log >$0.task
./grf --restore --list $0.task
rm -vf $0.task
vzctl exec 1002 umount /mnt/test -fl
vzctl exec 1002 umount /mnt/testtmp -fl
vzctl exec 1001 echo y \| gluster volume stop test
vzctl exec 1001 echo y \| gluster volume delete test
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