共計 1363 個字符,預計需要花費 4 分鐘才能閱讀完成。
丸趣 TV 小編給大家分享一下 cephfs 文件布局是怎么樣的,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!
常規(guī)文件的布局 xattrs 叫作 ceph.file.layout、目錄的布局 xattrs 叫作 ceph.dir.layout
布局字段:
pool
字符串,可指定 ID 或名字。它是文件的數(shù)據(jù)對象所在的 RADOS 存儲池。
stripe_unit
字節(jié)數(shù)、整數(shù)。一個文件的數(shù)據(jù)塊按照此尺寸(字節(jié))像 RAID 0 一樣分布。一文件所有條帶單元的尺寸一樣,最后一個條帶單元通常不完整——即它包含文件末尾的數(shù)據(jù)、還有數(shù)據(jù)末端到固定條帶單元尺寸之間的未使用“空間”。
stripe_count
整數(shù)。組成 RAID 0“條帶”數(shù)據(jù)的連續(xù)條帶單元數(shù)量。
object_size
整數(shù)個字節(jié)。文件數(shù)據(jù)按此尺寸分塊為 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 — 設(shè)置 pool id
setfattr -n ceph.file.layout.stripe_unit -v 1048576 filename – 設(shè)置條帶大小
setfattr –n ceph.file.layout.stripe_count –v 2 filename – 設(shè)置條帶跨越個數(shù)
setfattr –n ceph.file.layout.object_size –v 1048576 filename – 設(shè)置對象大小
查詢目錄特殊性:
使用 getfattr 讀出目錄布局:
getfattr -n ceph.dir.layout.pool dirname
使用 setfattr 修改目錄布局:
setfattr -n ceph.dir.layout.pool –v pool_num file_name — 設(shè)置 pool id
setfattr -n ceph.dir.layout.stripe_unit -v 1048576 filename – 設(shè)置條帶大小
setfattr -n ceph.dir.layout.stripe_count –v 2 filename – 設(shè)置條帶跨越個數(shù)
setfattr -n ceph.dir.layout.object_size –v 1048576 filename – 設(shè)置對象大小
以上是“cephfs 文件布局是怎么樣的”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學習更多知識,歡迎關(guān)注丸趣 TV 行業(yè)資訊頻道!