cephfs文件布局是怎么样的

45次阅读
没有评论

共计 1363 个字符,预计需要花费 4 分钟才能阅读完成。

丸趣 TV 小编给大家分享一下 cephfs 文件布局是怎么样的,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

常规文件的布局 xattrs 叫作 ceph.file.layout、目录的布局 xattrs 叫作 ceph.dir.layout

布局字段:
pool
  字符串,可指定 ID 或名字。它是文件的数据对象所在的 RADOS 存储池。
stripe_unit
  字节数、整数。一个文件的数据块按照此尺寸(字节)像 RAID 0 一样分布。一文件所有条带单元的尺寸一样,最后一个条带单元通常不完整——即它包含文件末尾的数据、还有数据末端到固定条带单元尺寸之间的未使用“空间”。
stripe_count
  整数。组成 RAID 0“条带”数据的连续条带单元数量。
object_size
  整数个字节。文件数据按此尺寸分块为 RADOS 对象

使用 getfattr 读出文件布局:
          getfattr -n ceph.file.layout filename

查询单个文件布局字段:
          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

使用 setfattr 修改文件布局:
      setfattr -n ceph.file.layout.pool –v pool_num  file_name  — 设置 pool id
      setfattr -n ceph.file.layout.stripe_unit -v 1048576 filename  – 设置条带大小
      setfattr –n ceph.file.layout.stripe_count –v 2 filename  – 设置条带跨越个数
      setfattr –n ceph.file.layout.object_size –v 1048576 filename  – 设置对象大小

查询目录特殊性:

使用 getfattr 读出目录布局:
        getfattr -n ceph.dir.layout.pool dirname

使用 setfattr 修改目录布局:
      setfattr -n ceph.dir.layout.pool –v pool_num  file_name  — 设置 pool id
      setfattr -n ceph.dir.layout.stripe_unit -v 1048576 filename  – 设置条带大小
      setfattr -n ceph.dir.layout.stripe_count –v 2 filename  – 设置条带跨越个数
      setfattr -n ceph.dir.layout.object_size –v 1048576 filename  – 设置对象大小

以上是“cephfs 文件布局是怎么样的”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注丸趣 TV 行业资讯频道!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-08-16发表,共计1363字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)