split-brain种类
- data split-brain
- metadata split-brain
- entry split-brain
- glid-mismatch
解决split-brain步骤
- 确定split-brain文件的路径
gluster volume heal info split-brain - 关闭正在open 该文件的app
- 确定脑裂的类型
getfattr -d -m . -e hex <file-path-on-brick>
或者
getfattr -n replica.split-brain-status <path-to-file>
eg.
getfattr -n replica.split-brain-status file100
file: file100
replica.split-brain-status="data-split-brain:no
metadata-split-brain:yes Choices:test-client-0,test-client-1"
- 确定正确的副本,并恢复
这里,主要说明一下使用cli解决data和metadata的方式
- Select the bigger-file as source
gluster volume heal <volume> split-brain bigger-file <file>- Select one replica as source for a particular file
gluster volume heal <volume> split-brain source-brick <host:brick> <file>- Trying to heal /dir would fail as it is in entry split-brain
gluster volume heal <volume> split-brain source-brick <host:brick>