ceph中pool的管理
1、創(chuàng)建pool
創(chuàng)建ceph pool的命令如下,它的參數(shù)包括pool名字、PG和PGP的數(shù)量。
-
若少于5個(gè)OSD, 設(shè)置pg_num為128。
-
5~10個(gè)OSD,設(shè)置pg_num為512。
-
10~50個(gè)OSD,設(shè)置pg_num為4096。
2、列出所有pool
rados lspools ceph osd lspools使用ceph osd pool ls detail查看每個(gè)pool的詳細(xì)信息
root@ceph01:~/mir2_data# ceph osd pool ls detail pool 7 'rbd' replicated size 2 min_size 1 crush_ruleset 0 object_hash rjenkins pg_num 64 pgp_num 64 last_change 188 flags hashpspool max_bytes 300647710720 stripe_width 0removed_snaps [1~3] pool 8 'hzb' replicated size 2 min_size 1 crush_ruleset 0 object_hash rjenkins pg_num 64 pgp_num 64 last_change 151 flags hashpspool stripe_width 0 pool 9 'cephfs_data' replicated size 2 min_size 1 crush_ruleset 0 object_hash rjenkins pg_num 100 pgp_num 100 last_change 157 flags hashpspool crash_replay_interval 45 stripe_width 0 pool 10 'cephfs_metadata' replicated size 2 min_size 1 crush_ruleset 0 object_hash rjenkins pg_num 100 pgp_num 100 last_change 155 flags hashpspool stripe_width 0?
3、設(shè)置pool的配額
設(shè)置允許最大object數(shù)量為100:
ceph osd pool set-quota mytest max_objects 100設(shè)置允許容量限制為10GB:
ceph osd pool set-quota mytest max_bytes $((10 * 1024 * 1024 * 1024))取消配額限制只需要把對(duì)應(yīng)值設(shè)為0即可。
4、刪除pool
ceph osd pool delete hzb-test hzb-test --yes-i-really-really-mean-it注意:hzb-test是pool的名稱(chēng),要寫(xiě)兩次
5、重命名pool
ceph osd pool rename {current-pool-name} {new-pool-name}6、查看pool狀態(tài)信息
root@ceph01:~/my-cluster# rados df pool name KB objects clones degraded unfound rd rd KB wr wr KB hzbtest 0 0 0 0 0 0 0 0 0 rbd 1 1 0 0 0 577 1283 631 13236total used 10557768 1total avail 303859392total space 3144171607、創(chuàng)建和刪除快照
ceph osd pool mksnap rbd rbd-snapceph osd pool rmsnap rbd rbd-snap
8、設(shè)置pool的key
通過(guò)以下語(yǔ)法設(shè)置pool的元數(shù)據(jù):
ceph osd pool set {pool-name} {key} {value}比如設(shè)置pool的冗余副本數(shù)量為3:
ceph osd pool set test-pool size 3設(shè)置pool
通過(guò)以下語(yǔ)法設(shè)置pool的元數(shù)據(jù):
ceph osd pool set {pool-name} {key} {value}比如設(shè)置pool的冗余副本數(shù)量為3:
ceph osd pool set test-pool size 3你可以設(shè)置下列鍵的值:
1)size
設(shè)置存儲(chǔ)池中對(duì)象的副本數(shù)。
Type: Integer
2)min_size
設(shè)置 IO 需要的最小副本數(shù)。
Type: Integer
3)crash_replay_interval
允許客戶(hù)端重放確認(rèn)而未提交請(qǐng)求的秒數(shù)。
Type: Integer
4)pgp_num
計(jì)算數(shù)據(jù)歸置時(shí)使用的有效歸置組數(shù)量。
Type: Integer
5)crush_ruleset
集群內(nèi)映射對(duì)象歸置時(shí)使用的規(guī)則集。
Type: Integer
通過(guò)get操作能夠獲取pool的配置值,比如獲取當(dāng)前pg_num:
ceph osd pool get test-pool pg_num獲取當(dāng)前副本數(shù):
ceph osd pool get test-pool size?
總結(jié)
以上是生活随笔為你收集整理的ceph中pool的管理的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Android studio 插件安装
- 下一篇: nginx日志格式、参数及切分