Get the App
SLTechnology News&Howtos  ›  Servers  › 

What is the layout of cephfs files?

Shulou Source: shulou.com Published: 2022-05-31 18:42:03 10月03日 Update

Editor to share with you what the layout of cephfs files is like, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

The layout xattrs of regular files is called ceph.file.layout, and the layout xattrs of directories is called ceph.dir.layout.

Layout field:

Pool

String, either ID or first name can be specified. It is the RADOS storage pool where the data object of the file resides.

Stripe_unit

Number of bytes, integers. The data blocks of a file are distributed according to this size (bytes) like RAID 0. All stripe units in a file are of the same size, and the last stripe unit is usually incomplete-that is, it contains the data at the end of the file and the unused "space" between the end of the data and the size of the fixed stripe unit.

Stripe_count

Round number. The number of consecutive stripe units that make up the RAID 0 stripe data.

Object_size

Integer bytes. File data is divided into RADOS objects according to this size

Use getfattr to read out the file layout:

Getfattr-n ceph.file.layout filename

Query a single file layout field:

Getfattr-n ceph.file.layout.pool filename

Getfattr-n ceph.file.layout.stripe_unit filename

Getfattr-n ceph.file.layout.stripe_count filename

Getfattr-n ceph.file.layout.object_size filename

Use setfattr to modify the file layout:

Setfattr-n ceph.file.layout.pool-v pool_num file_name-set pool id

Setfattr-n ceph.file.layout.stripe_unit-v 1048576 filename-- sets the stripe size

Setfattr-n ceph.file.layout.stripe_count-v 2 filename-- sets the number of stripes across

Setfattr-n ceph.file.layout.object_size-v 1048576 filename-- sets the object size

Query directory particularity:

Use getfattr to read out the directory layout:

Getfattr-n ceph.dir.layout.pool dirname

Use setfattr to modify the directory layout:

Setfattr-n ceph.dir.layout.pool-v pool_num file_name-set pool id

Setfattr-n ceph.dir.layout.stripe_unit-v 1048576 filename-- sets the stripe size

Setfattr-n ceph.dir.layout.stripe_count-v 2 filename-- sets the number of stripes across

Setfattr-n ceph.dir.layout.object_size-v 1048576 filename-- sets the object size

The above is all the content of this article "what is the layout of cephfs files?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: File layout stripe data unit size object size directory byte integer article number content field query special not so between single Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Apple Shulou Tech Info Linux MariaDB