CEPH快速搭建四(ceph的pool池)

pool是ceph存储数据时的逻辑分区,它起到namespace的作用。其他分布式存储系统,比如Mogilefs、Couchbase、Swift都有pool的概念,只是叫法不同。每个pool包含一定数量的PG,PG里的对象被映射到不同的OSD上,因此pool是分布到整个集群的。
除了隔离数据,我们也可以分别对不同的POOL设置不同的优化策略,比如副本数、数据清洗次数、数据块及对象大小等。


查看pool
[ceph@ceph-admin cluster]$ rados lspools
rbd
[ceph@ceph-admin cluster]$ ceph osd lspools
0 rbd,
[ceph@ceph-admin cluster]$ 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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
通常在创建pool之前,需要覆盖默认的pg_num,官方推荐:
• 若少于5个OSD, 设置pg_num为128。
• 5~10个OSD,设置pg_num为512。
• 10~50个OSD,设置pg_num为4096。
• 超过50个OSD,可以参考pgcalc计算
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ceph@ceph-admin cluster]$ ceph osd pool create pool1 64
pool 'pool1' created

调整pool副本数(之前安装的pool副本默认是3,这里调整为2)
[ceph@ceph-admin cluster]$ ceph osd pool get pool1 size
size: 3
[ceph@ceph-admin cluster]$ ceph osd pool set pool1 size 2
set pool 1 size to 2
[ceph@ceph-admin cluster]$ ceph osd pool get pool1 size
size: 2


删除pool
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ceph@ceph-admin cluster]$ 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.
备注:删除的时候为了安全,要求跟两次名字,并加上--yes-i-really-really-mean-it
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ceph@ceph-admin cluster]$ ceph osd pool delete pool1 pool1 --yes-i-really-really-mean-it
pool 'pool1' removed

重命名pool
[ceph@ceph-admin ~]$ ceph osd pool rename pool1 pool2
[ceph@ceph-admin ~]$ ceph osd pool rename pool2 pool1

 

pool配额

配置pool的对象最大100个
[ceph@ceph-admin cluster]$ ceph osd pool set-quota pool1 max_objects 100
配置pool的容量大小(10G)
[ceph@ceph-admin cluster]$ ceph osd pool set-quota pool1 max_bytes $((10*1024*1024*1024))

pool快照管理

创建快照
[ceph@ceph-admin ~]$ ceph osd pool mksnap pool1 pool1_snap
删除快照
[ceph@ceph-admin ~]$ ceph osd pool rmsnap pool1 pool1_snap

书写文档不易,如果你觉得我写得可以打个赏呗

https://www.fageka.com/store/item/s/id/Yx6TZ1m0747.html

在定义了pool池后,下一章节进行卷(image)的管理

CEPH快速搭建五(ceph的image管理)

https://blog.csdn.net/xx496146653/article/details/89248050

你可能感兴趣的:(ceph)