The. Glusterfs directory size is basically equal to all the file sizes in the current brick, because the main store is the hard link to the files in brick.
The. Glusterfs directory is a new structure introduced in version 3.3, what is it used for?
What is Gfid?
As you may know, Glusterfs stores the metadata information in the file's extended properties. One of the meta data is Trusted.gfid, this is the inode number, in the cluster, each file has a unique UUID number, this in Gluster The 3.1 and 3.2 versions work well, but there are often some miscalculations in the automatic file repair (AFR) process.
This gfid is used to build. Glusterfs This directory structure, each file corresponds to a hard link placed in the. Glusterfs directory, the storage rule is that the first two numbers create a directory, then two numbers to create a directory, and then the directory is a complete UUID hard link.
For example:
# getfattr-m. -d-e hex/data/glusterfs/d_home/stat.c
Getfattr:removing leading '/' from absolute path names
# file:data/glusterfs/d_home/stat.c
trusted.afr.home-client-10=0x000000000000000000000000
trusted.afr.home-client-11=0x000000000000000000000000
trusted.afr.home-client-9=0x000000000000000000000000
Trusted.gfid=0xc62757554baf4a33bc7690c56dac23e0
A hard link is created:
/data/glusterfs/d_home/.glusterfs/c6/27/c6275755-4baf-4a33-bc76-90c56dac23e0
Why do you do this?
Several methods of deleting, renaming, and building hard links before are flawed. If a connection to a replicated volume is lost and the rename operation is missing, the automatic repair process does not know that it is a purely delete or rename operation, which can cause problems and may result in confusion caused by duplicate files.
Now a file is deleted, the. Glusterfs directory of the corresponding files will also be deleted, the automatic repair daemon will be on the good server traversal, see if the file is present, because the corresponding Gfid file is deleted, so it is really deleted, if the file is missing, However, the corresponding Gfid file exists, the description is renamed, the expired server will delete the file name, but will not delete the corresponding Gfid file, once the automatic repair daemon traversal to the new file name, will directly create a hard link to the Gfid file, because the data is still on the server, So repairing a renamed file avoids the data transfer.
If the Gfid file is a regular file rather than a hard link, it's almost finished. Link separation occurs because a file expires and the client has no way of knowing that one file and another have the same gfid, so it will recreate one, creating a large number of unnecessary duplicate files, and after using a hard link, each Gfid file will have a file. There will be no space waste.
NFSV4 Support
Soon, Glusterfs will support NFS V4 and will use anonymous file descriptors. The Gfid file allows you to create a Gfid file in the directory, but does not create the corresponding entry in the directory.
Does this have any new requirements for administrators?
As an administrator, learn more about the Gfid mechanism for file repair and cleft brain repair that is helpful and recommended.
first, the gfid for each brick root directory is 00000000-0000-0000-0000-000000000001, this file is placed in the . glusterfs/00/00 directory, which is actually a symbolic link, connects to the ".. /.. /.. ", other directories are also linked to this directory.
If deleting a file does not delete the corresponding Gfid file, the repair process will repair the file, and if the Gfid file is corrupted, the corresponding file will also be corrupted.
Reference:
https://joejulian.name/blog/what-is-this-new-glusterfs-directory-in-33/
Https://www.gluster.org/pipermail/gluster-users/2014-January/015494.html
This article is from the "Members Doukua" blog, make sure to keep this source http://dangzhiqiang.blog.51cto.com/7961271/1787940
. Glusterfs Directory Description