[script]Add new file for ceph pg repair
This commit is contained in:
parent
5c66bbb619
commit
1d88aac14e
1 changed files with 14 additions and 0 deletions
14
pg_repair
Normal file
14
pg_repair
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
pglist_arr=( $(ceph health detail | grep pg | grep active | awk '{print $2}' ))
|
||||||
|
|
||||||
|
echo ${pglist_arr[*]}
|
||||||
|
|
||||||
|
for ((i=0; i<${#pglist_arr[@]}; i++)) do
|
||||||
|
if [ 1 -eq $(ceph pg repair ${pglist_arr[$i]} | grep repair | grep instructing | wc -l) ]; then
|
||||||
|
echo repair error
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echo ${pglist_arr[$i]} repair ok
|
||||||
|
sleep 10
|
||||||
|
done
|
Loading…
Reference in a new issue