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 filenameip

查询单个文件布局字段:
              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  --设置对象大小get

查询目录特殊性:it

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

使用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  --设置对象大小file

相关文章
相关标签/搜索