ceph常用命令之pool相關(guān)命令有哪些

這篇文章將為大家詳細(xì)講解有關(guān)ceph常用命令之pool相關(guān)命令有哪些,小編覺(jué)得挺實(shí)用的,因此分享給大家做個(gè)參考,希望大家閱讀完這篇文章后可以有所收獲。

我們提供的服務(wù)有:成都網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì)、微信公眾號(hào)開(kāi)發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、鶴壁ssl等。為1000多家企事業(yè)單位解決了網(wǎng)站和推廣的問(wèn)題。提供周到的售前咨詢(xún)和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的鶴壁網(wǎng)站制作公司

1.1 查詢(xún)系統(tǒng)中所有的pool

命令格式:

ceph osd lspools
或rados lspools

1.2      創(chuàng)建pool

(1)    指定pg數(shù)目、pgp數(shù)目等創(chuàng)建pool

命令格式:

ceph osd pool create <poolname>{pg-num}{pgp-num} {replicated|erasure} {<erasure_code_profile>} {<ruleset>}

命令含義:

 Pool分為replicated pool和erasure code pool,replicate pool以多副本的方式提供數(shù)據(jù)備份,EC pool使用糾刪碼方式提供數(shù)據(jù)安全

 創(chuàng)建erasure pool還可以指定erasure_code_profile,erasure_code_profile 使用命令osd erasure-code-profile set指定,erasure-code-profile參數(shù)含義:

    directory=<dir>         \ # plugin directory absolute path

    plugin=jerasure         \ # plugin name (only jerasure)

    k=<k>                   \ # data chunks (default 2)

    m=<m>                   \ # coding chunks (default 2)

    technique=<technique>   \ # coding technique

 Jerasure 是多種Erasure Coding算法的一個(gè)開(kāi)源庫(kù),采用C/C++實(shí)現(xiàn),活躍很高,且使用廣,technique可選項(xiàng):reed_sol_van, reed_sol_r6_op, cauchy_orig, cauchy_good, liberation, blaum_roth and liber8tion.

    每個(gè)pg占用一定內(nèi)存和CPU、且PG數(shù)目的增加會(huì)增加peer數(shù)目,因此每個(gè)pool配置的PG數(shù)目有一定的限制,否則會(huì)影響整個(gè)集群的性能,每個(gè)pool大概需要的PG數(shù)目為:

                  (OSDs * 100)

Total PGs =  ------------

                 OSD per object

OSD per object對(duì)于replicated pool來(lái)說(shuō)為副本數(shù),對(duì)于EC pool來(lái)說(shuō)是k+m

(2) 指定uid創(chuàng)建pool

命令格式:

mkpool <pool-name> [123[ 4]]

  命令含義:

創(chuàng)建pool,其擁有者uid為123,crush rule為4

 

1.3 修改pool參數(shù)

命令格式:

ceph osd pool set {pool-name} {key} {value}

命令含義:

Key值含義:

Size:pool副本數(shù)

min_size:pool最小副本數(shù),當(dāng)pool中object副本數(shù)小于min_size, object將停止接收I/O

crash_replay_interval: PG修復(fù)期間,運(yùn)行客戶(hù)端重放請(qǐng)求而不提交時(shí)間間隔(單位s,默認(rèn)45s)

pgp_num:使用pgp_num計(jì)算pg id

crush_ruleset:pool使用的crush rule_id,ceph osd crush rule dump可查詢(xún)所有配置的策略

auid:設(shè)置pool歸屬用戶(hù)id

hit_set_type: cache命中跟蹤類(lèi)型設(shè)置,默認(rèn)為bloom,其他的類(lèi)型包括explicit_hash、explicit_object

hit_set_period:

hit_set_count:

hit_set_ fpp:bloom誤檢率

cache_target_dirty_ratio:默認(rèn).4,當(dāng)cache臟數(shù)據(jù)到達(dá)40%,將臟數(shù)據(jù)刷到后端pool中

cache_target_full_ratio:默認(rèn).8,d當(dāng)cache中數(shù)據(jù)量到達(dá)80%,將cache中冷數(shù)據(jù)刪除

target_max_bytes:cache pool最大容量

target_max_objects:cache pool最大存儲(chǔ)的object數(shù)目

cache_min_flush_age: object刷到后端pool的最小年齡,單位為s

cache_min_evict_age:object從cache中刪除的最小年齡,單位為s

1.4 查詢(xún)pool參數(shù)

命令格式:

osd pool get <poolname> size|min_size| crash_replay_interval|pg_num|pgp_num| crush_ruleset| 

hit_set_type|hit_set_period|hit_set_count|hit_set_fpp|auid|target_max_objects|target_max_bytes|    

cache_target_dirty_ratio|cache_target_full_ratio|cache_min_flush_age|cache_min_evict_age|erasure_code_profile

或者使用ceph osd dump |grep pool顯示所有pool的參數(shù)

1.5 刪除pool

命令格式:

ceph osd pool delete {pool-name} [{pool-name} \ [-yes-i-really-really-mean-it]

或

rados rmpool <pool-name> [<pool-name> --yes-i-really-really-mean-it]

命令含義:

刪除pool,當(dāng)pool有數(shù)據(jù)或者配置了用戶(hù)等信息,需要將這些信息手動(dòng)刪除掉,否則強(qiáng)制刪除后這些信息還會(huì)在

1.6 重命名pool

命令格式:

ceph osd pool rename {current-pool-name} {new-pool-name}

1.7 查詢(xún)pool配額

命令格式

ceph osd pool get-quota <poolname>

命令含義:

查詢(xún)pool容量和最大object數(shù)目

1.8 設(shè)置pool配額

命令格式

ceph osd pool set-quota <poolname> max_objects|max_bytes <val>

命令含義:

設(shè)置pool容量和最大object數(shù)目

1.9 查詢(xún)pool屬性

命令格式:

ceph osd pool stats {<poolname>}

1.10 創(chuàng)建pool快照

命令格式:

ceph osd pool mksnap <poolname> <snapname>

該命令等同于:
rados mksnap <snapname> -p <poolname>

命令含義:對(duì)pool中所有的object做快照

1.11 查詢(xún)pool快照

命令格式:

rados lssnap –p <poolname>

命令含義:

查詢(xún)pool快照

1.12 pool快照回滾

命令格式:

rados rollback <obj-name> <snap-name>  -p < poolname >

命令含義:目前只能針對(duì)pool中某個(gè)object進(jìn)行回滾,不能整個(gè)pool回滾,我們可以考慮自己實(shí)現(xiàn)下?

1.13 cache pool配置和刪除

(1) 將一個(gè)pool配置為另外一個(gè)pool cache命令:

ceph osd tier add <poolname> <cachepoolname>

或

osd tier add-cache <poolname> <cachepoolname> [cachepoolname size

(2) 設(shè)置cache pool模式:

ceph osd pool set <cachepoolname> cache-mode <val>

<val>一共有4個(gè):

‘none’, ‘writeback’, ‘forward’, and ‘readonly’

 ‘writeback’和‘readonly’見(jiàn)2.3節(jié)

  ‘forward’將cache pool關(guān)閉之前,需要將cache pool模式改為’ forward’,不接收客戶(hù)端的IO后,才將cache pool數(shù)據(jù)刷到后端pool

(3) 如果將cache pool工作模式設(shè)置為writeback‘,需要執(zhí)行下面命令

Cache pool才能工作,目的將I/O映射到cache pool中

ceph osd tier set-overlay <poolname> <cachepoolname>

(4)將cache pool數(shù)據(jù)刷到后端pool

rados -p {cachepool} cache-flush-evict-all

(5)解除cache pool和后端pool對(duì)應(yīng)關(guān)系

ceph osd tier remove-overlay <cachepoolname>

ceph osd tier remove <poolname> <cachepoolname>

關(guān)于“ceph常用命令之pool相關(guān)命令有哪些”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,使各位可以學(xué)到更多知識(shí),如果覺(jué)得文章不錯(cuò),請(qǐng)把它分享出去讓更多的人看到。

網(wǎng)頁(yè)題目:ceph常用命令之pool相關(guān)命令有哪些
轉(zhuǎn)載注明:http://muchs.cn/article0/johioo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App開(kāi)發(fā)、微信小程序、電子商務(wù)Google、定制網(wǎng)站全網(wǎng)營(yíng)銷(xiāo)推廣

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話(huà):028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

網(wǎng)站建設(shè)網(wǎng)站維護(hù)公司