ceph集群存储池的资源配额
一.存储池资源配额概述
ceph集群官方支持基于对象存储数量和数据存储的大小两种方式限制存储资源配额。
官网连接:
https://docs.ceph.com/en/latest/rados/operations/pools/#setting-pool-quotas
二.存储池资源配额实战
1.创建存储池
[root@ceph143 ~]# ceph osd pool create yinzhengjie-p2 64 64
pool 'yinzhengjie-p2' created
[root@ceph143 ~]#
2.查看存储池的资源限制信息
[root@ceph143 ~]# ceph osd pool get-quota yinzhengjie-p2
quotas for pool 'yinzhengjie-p2':
max objects: N/A
max bytes : N/A
[root@ceph143 ~]#
3.设置存储池的资源限制
1 限制存储池最大上线有1500个对象
[root@ceph143 ~]# ceph osd pool set-quota yinzhengjie-p2 max_objects 1500
set-quota max_objects = 1500 for pool yinzhengjie-p2
[root@ceph143 ~]#
[root@ceph143 ~]# ceph osd pool get-quota yinzhengjie-p2
quotas for pool 'yinzhengjie-p2':
max objects: 1.50k objects
max bytes : N/A
[root@ceph143 ~]#
2 限制存储池最大存储10G大小
[root@ceph143 ~]# ceph osd pool set-quota yinzhengjie-p2 max_bytes 10737418240
set-quota max_bytes = 10737418240 for pool yinzhengjie-p2
[root@ceph143 ~]#
[root@ceph143 ~]# ceph osd pool get-quota yinzhengjie-p2
quotas for pool 'yinzhengjie-p2':
max objects: 1.50k objects
max bytes : 10 GiB
[root@ceph143 ~]#
3.清除资源限制
[root@ceph141 ~]# ceph osd pool get-quota yinzhengjie-p2
quotas for pool 'yinzhengjie-p2':
max objects: 1.50k objects
max bytes : 10 GiB
[root@ceph141 ~]#
[root@ceph141 ~]# ceph osd pool set-quota yinzhengjie-p2 max_objects 0
set-quota max_objects = 0 for pool yinzhengjie-p2
[root@ceph141 ~]#
[root@ceph141 ~]# ceph osd pool get-quota yinzhengjie-p2
quotas for pool 'yinzhengjie-p2':
max objects: N/A
max bytes : 10 GiB
[root@ceph141 ~]#
[root@ceph141 ~]# ceph osd pool set-quota yinzhengjie-p2 max_bytes 0
set-quota max_bytes = 0 for pool yinzhengjie-p2
[root@ceph141 ~]#
[root@ceph141 ~]# ceph osd pool get-quota yinzhengjie-p2
quotas for pool 'yinzhengjie-p2':
max objects: N/A
max bytes : N/A
[root@ceph141 ~]#
本文来自博客园,作者:尹正杰,转载请注明原文链接:https://www.cnblogs.com/yinzhengjie/p/14260165.html,个人微信: "JasonYin2020"(添加时请备注来源及意图备注,有偿付费)
当你的才华还撑不起你的野心的时候,你就应该静下心来学习。当你的能力还驾驭不了你的目标的时候,你就应该沉下心来历练。问问自己,想要怎样的人生。