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

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

生活随笔

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

编程问答

ceph学习之pool

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

pool是ceph存儲(chǔ)數(shù)據(jù)時(shí)的邏輯分區(qū),它起到namespace的作用。其他分布式存儲(chǔ)系統(tǒng),比如Mogilefs、Couchbase、Swift都有pool的概念,只是叫法不同。每個(gè)pool包含一定數(shù)量的PG,PG里的對(duì)象被映射到不同的OSD上,因此pool是分布到整個(gè)集群的。

除了隔離數(shù)據(jù),我們也可以分別對(duì)不同的POOL設(shè)置不同的優(yōu)化策略,比如副本數(shù)、數(shù)據(jù)清洗次數(shù)、數(shù)據(jù)塊及對(duì)象大小等。

?

查看POOL

查看pool有多種方式:

[root@mon1 ~]# rados lspools rbd testpool testpool2

?

[root@mon1 ~]# ceph osd lspools 0 rbd,1 testpool,2 testpool2, [root@mon1 ~]# 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 1 flags hashpspool stripe_width 0 pool 1 'testpool' replicated size 2 min_size 2 crush_ruleset 0 object_hash rjenkins pg_num 128 pgp_num 128 last_change 20 flags hashpspool stripe_width 0 pool 2 'testpool2' replicated size 2 min_size 2 crush_ruleset 0 object_hash rjenkins pg_num 128 pgp_num 128 last_change 22 flags hashpspool crash_replay_interval 45 stripe_width 0 [root@mon1 ~]#

毫無(wú)疑問(wèn)ceph osd dump輸出的信息最詳盡,包括pool ID、副本數(shù)量、CRUSH規(guī)則集、PG和PGP數(shù)量等

?創(chuàng)建POOL

通常在創(chuàng)建pool之前,需要覆蓋默認(rèn)的pg_num,官方推薦:

  • 若少于5個(gè)OSD, 設(shè)置pg_num為128。
  • 5~10個(gè)OSD,設(shè)置pg_num為512。
  • 10~50個(gè)OSD,設(shè)置pg_num為4096。
  • 超過(guò)50個(gè)OSD,可以參考pgcalc計(jì)算。
[root@mon1 ~]# ceph osd pool create pool1 64 pool 'pool1' created [root@mon1 ~]#

創(chuàng)建pool時(shí)要設(shè)置pg_num

調(diào)整POOL副本

[root@mon1 ~]# ceph osd pool set pool1 size 2 set pool 3 size to 2 [root@mon1 ~]#

刪除POOL

[root@mon1 ~]# ceph osd pool delete pool1 Error EPERM: WARNING: this will *PERMANENTLY DESTROY* all data stored in pool pool1. If you are *ABSOLUTELY CERTAIN* that is what you want, pass the pool name *twice*, followed by --yes-i-really-really-mean-it. [root@mon1 ~]# ceph osd pool delete pool1 pool1 --yes-i-really-really-mean-it pool 'pool1' removed

note:刪除pool時(shí),pool名字要輸入兩次同時(shí)要加入--yes-i-really-really-mean-it參數(shù)

設(shè)置POOL配額

[root@mon1 ~]# ceph osd pool set-quota pool1 max_objects 100 #最大100個(gè)對(duì)象 set-quota max_objects = 100 for pool pool1 [root@mon1 ~]# ceph osd pool set-quota pool1 max_bytes $((10 * 1024 * 1024 * 1024)) #容量大小最大為10G set-quota max_bytes = 10737418240 for pool pool1

重命名POOL

[root@mon1 ~]# ceph osd pool rename pool1 pool2 pool 'pool1' renamed to 'pool2' [root@mon1 ~]#

查看POOL狀態(tài)信息

[root@mon1 ~]# rados df pool name KB objects clones degraded unfound rd rd KB wr wr KB pool2 0 0 0 0 0 0 0 0 0 rbd 0 0 0 0 0 0 0 0 0 testpool 0 0 0 0 0 0 0 0 0 testpool2 0 0 0 0 0 0 0 0 0total used 118152 0total avail 47033916total space 47152068 [root@mon1 ~]#

創(chuàng)建快照

ceph支持對(duì)整個(gè)pool創(chuàng)建快照(和Openstack Cinder一致性組區(qū)別?),作用于這個(gè)pool的所有對(duì)象。但注意ceph有兩種pool模式:

  • Pool Snapshot,我們即將使用的模式。創(chuàng)建一個(gè)新的pool時(shí),默認(rèn)也是這種模式。
  • Self Managed Snapsoht,用戶(hù)管理的snapshot,這個(gè)用戶(hù)指的是librbd,也就是說(shuō),如果在pool創(chuàng)建了rbd實(shí)例就自動(dòng)轉(zhuǎn)化為這種模式。

這兩種模式是相互排斥,只能使用其中一個(gè)。因此,如果pool中曾經(jīng)創(chuàng)建了rbd對(duì)象(即使當(dāng)前刪除了所有的image實(shí)例)就不能再對(duì)這個(gè)pool做快照了。反之,如果對(duì)一個(gè)pool做了快照,就不能創(chuàng)建rbd image了。

[root@mon1 ~]# ceph osd pool mksnap pool2 pool2_snap created pool pool2 snap pool2_snap [root@mon1 ~]#

刪除快照

[root@mon1 ~]# ceph osd pool rmsnap#remove snapshot <snap> from <pool> [root@mon1 ~]# ceph osd pool rmsnap pool2 pool2_snap removed pool pool2 snap pool2_snap [root@mon1 ~]#

?

轉(zhuǎn)載于:https://www.cnblogs.com/netmouser/p/6878885.html

創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來(lái)咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)

總結(jié)

以上是生活随笔為你收集整理的ceph学习之pool的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

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