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 ~]# 
posted @ 2021-01-10 23:26  尹正杰  阅读(137)  评论(0编辑  收藏  举报