目次

操作

レプリカ構成にブリック追加

[root@mc-adm02 ~]# gluster peer probe adm03
peer probe: success

[root@mc-adm02 ~]# gluster vol add-brick vol01 replica 3 adm03:/mnt/addVol/gfs01
volume add-brick: success

[root@mc-adm02 ~]# gluster vol heal vol01 full
Launching Heal operation on volume vol01 has been successful
Use heal info commands to check status

スプリットブレインの解消

https://sites.google.com/site/glusterfstech/recovery/split-brain

# vi delfile.sh
#!/bin/sh
#
#   delfile.sh - Delete file and hardlink in bricks
#

function usage {
    echo "Usage: $0 <brick dir> <file path>"
    exit 1
}

[[ -z $1 || -z $2 ]] && usage

brick=$1
file=$2

if [[ ! -f ${file} ]]; then
    echo "File ${file} is not found."
    usage
fi

gfid=$(getfattr -n trusted.gfid --absolute-names -e hex ${file} | grep 0x | cut -d'x' -f2)
hlink=${brick}/.glusterfs/${gfid:0:2}/${gfid:2:2}/${gfid:0:8}-${gfid:8:4}-${gfid:12:4}-${gfid:16:4}-${gfid:20:12}

if [[ ! -f ${hlink} ]]; then
    echo "Hardlink ${hlink} is not found."
    usage
fi

echo "Delete file: ${file}"
echo "Delete hardlink: ${hlink}"
rm -f ${file} ${hlink}
# ./delfile.sh
Usage: ./delfile.sh <brick dir> <file path>

# ./delfile.sh /data/brick01 /data/brick01/dir01/file01.txt 
Delete file: /data/brick01/dir01/file01.txt
Delete hardlink: /data/brick01/.glusterfs/14/bb/14bb8bab-5e79-4413-a7c0-adf2994b9634