ceph學習(四) pool使用

創(chuàng)建,查看,刪除pool,查看,修改pool參數(shù)命令總結(jié)

  1. 創(chuàng)建pool命令:
    ceph的pool有兩種類型,一種是副本池,一種是ec池,創(chuàng)建時也有所區(qū)別

1.1 創(chuàng)建副本池:

$ sudo ceph osd pool create pool-name pg_num pgp_num

如:

[root@node3 ~]# ceph osd pool create testpool 128 128 
pool 'testpool' created

1.2 創(chuàng)建ec池:

$ sudo ceph osd pool create pool-name pg_num pgp_num erasure

如:

[root@node3 ~]# ceph osd pool create ecpool 12 12 erasure
pool 'ecpool' created
  1. 查看pool命令
    查看pool命令:
[root@node3 ~]# ceph osd lspools
2 testpool,4 ecpool,

[root@node3 ~]# rados lspools
testpool
ecpool

兩個命令的區(qū)別就是第一個可以查看pool的id

查看pool的詳細配置信息:

[root@node3 ~]# ceph osd pool ls detail

pool 0 'rbd' replicated size 3 min_size 2 crush_ruleset 0 object_hash rjenkins pg_num 64 pgp_num 64 last_change 34 flags hashpspool stripe_width 0
    removed_snaps [1~b]
pool 2 'cephfs_data' replicated size 3 min_size 2 crush_ruleset 0 object_hash rjenkins pg_num 100 pgp_num 100 last_change 2917 flags hashpspool crash_replay_interval 45 stripe_width 0
    removed_snaps [2~1,4~5,f~1,12~1]
pool 3 'cephfs_metadata' replicated size 3 min_size 2 crush_ruleset 0 object_hash rjenkins pg_num 100 pgp_num 100 last_change 41 flags hashpspool stripe_width 0
pool 6 'test-bigdata' erasure size 5 min_size 3 crush_ruleset 1 object_hash rjenkins pg_num 64 pgp_num 64 last_change 2975 flags hashpspool stripe_width 4128

[root@node3 ~]# ceph osd dump|grep pool

pool 0 'rbd' replicated size 3 min_size 2 crush_ruleset 0 object_hash rjenkins pg_num 64 pgp_num 64 last_change 34 flags hashpspool stripe_width 0
pool 2 'cephfs_data' replicated size 3 min_size 2 crush_ruleset 0 object_hash rjenkins pg_num 100 pgp_num 100 last_change 2917 flags hashpspool crash_replay_interval 45 stripe_width 0
pool 3 'cephfs_metadata' replicated size 3 min_size 2 crush_ruleset 0 object_hash rjenkins pg_num 100 pgp_num 100 last_change 41 flags hashpspool stripe_width 0
pool 6 'test-bigdata' erasure size 5 min_size 3 crush_ruleset 1 object_hash rjenkins pg_num 64 pgp_num 64 last_change 2975 flags hashpspool stripe_width 4128

可以看出兩個命令輸出內(nèi)容是一樣的

查看pool的用量信息:

[root@node3 ~]# rados df
POOL_NAME USED OBJECTS CLONES COPIES MISSING_ON_PRIMARY UNFOUND DEGRADED RD_OPS RD WR_OPS WR 
ecpool       0       0      0      0                  0       0        0      0  0      0  0 
testpool     0       0      0      0                  0       0        0      0  0      0  0 
total_objects    0
total_used       6386M
total_avail      55053M
total_space      61440M
  1. 刪除pool命令
$ sudo ceph osd pool delete {pool-name} {pool-name} --yes-i-really-really-mean-it

如:

[root@node3 ~]# ceph osd pool delete ecpool ecpool  --yes-i-really-really-mean-it
pool 'ecpool' removed

如果刪除pool時提示error請參考: 刪除pool error的解決方法

  1. 獲取pool參數(shù):
$ sudo ceph osd pool get {pool-name} {key}

如獲取副本池的副本數(shù):

[root@node3 ~]# ceph osd pool get testpool size
size: 3
  1. 設置pool參數(shù):
$ sudo ceph osd pool set  {pool-name} {key} {value}

如設置副本池的副本數(shù):

[root@node3 ~]# ceph osd pool set testpool size 2
set pool 2 size to 2
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容