日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

ceph中pool的管理

發(fā)布時(shí)間:2025/3/15 编程问答 19 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ceph中pool的管理 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

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。

ceph osd pool create mytest 128 128 pool 'mytest' created

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 314417160

7、創(chuàng)建和刪除快照

ceph osd pool mksnap rbd rbd-snap
ceph 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)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。