Recover Glusterfs files Split brain step
1. Execute the following command to get the path to the split-brain file.
# Gluster Volume Heal Volname Info split-brain
Client access to the split brain file will report I/O errors.
2. Close the process of accessing the rip-brain files on the Mount client. If a virtual machine is using a split-brain file, the virtual machine must be shut down.
3. Obtain and verify the change records for the extended properties through the Getfattr command, and then use the extended properties to determine which brick contain the trusted files.
# getfattr-d-M. -E Hex <file-path-on-brick>
[Email protected]:/LETV/DISK4] $getfattr-D-M. -E hex File1
# File:file1
trusted.afr.plane-client-0=0x000000000000000000000000
trusted.afr.plane-client-1=0x000000000000000000000000
Trusted.gfid=0x4e028c9b64234502ba304eba44e16da4
The file Change record property description, as shown in the following example:
0x 000003d7 00000001 000000110
| | |
| | \_ Changelog of directory entries
| \_ Changelog of metadata
\ _ Changelog of data
First 8 * * * background field record data change record
Intermediate 8-bit blue background field record metadata change record
last 8-bit pink background field record index Gfid change record
Metadata and index Gfid change corresponding fields are valid for the directory.
For normal files, the data and metadata corresponding fields are valid.
For special files, such as device files, the metadata corresponding fields are valid.
A file is cracked brain, but the data is cracked brain, can also be meta-data splitting brain, also can be data and meta-data simultaneously split the brain.
A meta-data, data-splitting brain example is as follows:
# getfattr-d-M. -E hex/gfs/brick-?/a
Getfattr:removing leading '/' from absolute path names
\ #file: gfs/brick-a/a
trusted.afr.vol-client-0=0x000000000000000000000000
trusted.afr.vol-client-1=0x000003d70000000100000000
trusted.gfid=0x80acdbd886524f6fbefa21fc356fed57
\ #file: gfs/brick-b/a
trusted.afr.vol-client-0=0x000003b00000000100000000
trusted.afr.vol-client-1=0x000000000000000000000000
trusted.gfid=0x80acdbd886524f6fbefa21fc356fed57
4. Select the correct copy.
5. Resolve split-brain problems by resetting related fields
1) Solve data splitting brain: RESET data field corresponding attribute value
2) Resolve metadata split brain: Reset metadata fields corresponding property values
3) Resolve index split brain: Delete an invalid copy, and you must delete the corresponding Gfid-link file in the. Glusterfs Directory
Before deleting the Gfid-link file, make sure that the file you are deleting on the current brick does not have a hard link and must be deleted if any.
6. Trigger Automatic Repair
# ls-l <file-path-on-gluster-mount>
Or
# Gluster Volume Heal Volname
Attention:
For the property is normal, the file content caused by the split brain, heal command can not repair, need to execute heal full command, of course LS can also.
Repair method, delete the error copy and the corresponding Gfid file.
This article is from the "Members Doukua" blog, make sure to keep this source http://dangzhiqiang.blog.51cto.com/7961271/1713501
Glusterfs How to repair the split brain files?