You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by xy...@apache.org on 2020/10/27 17:14:38 UTC

[hadoop-ozone] branch master updated: HDDS-3731. [doc]add storage space quota document. (#1516)

This is an automated email from the ASF dual-hosted git repository.

xyao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hadoop-ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new c67aa2f  HDDS-3731. [doc]add storage space quota document. (#1516)
c67aa2f is described below

commit c67aa2fd4287df12610f5d4d4c1ff27bb414cc64
Author: micah zhao <mi...@tencent.com>
AuthorDate: Wed Oct 28 01:14:25 2020 +0800

    HDDS-3731. [doc]add storage space quota document. (#1516)
---
 hadoop-hdds/docs/content/feature/Quota.md    | 74 ++++++++++++++++++++++++++++
 hadoop-hdds/docs/content/feature/Quota.zh.md | 67 +++++++++++++++++++++++++
 2 files changed, 141 insertions(+)

diff --git a/hadoop-hdds/docs/content/feature/Quota.md b/hadoop-hdds/docs/content/feature/Quota.md
new file mode 100644
index 0000000..5be9f4d
--- /dev/null
+++ b/hadoop-hdds/docs/content/feature/Quota.md
@@ -0,0 +1,74 @@
+---
+title: "Quota in Ozone"
+date: "2020-October-22"
+weight: 4
+summary: Quota in Ozone
+icon: user
+menu:
+   main:
+      parent: Features
+summary: Introduction to Ozone Quota
+---
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+So far, we know that Ozone allows users to create volumes, buckets, and keys. A Volume usually contains several buckets, and each Bucket also contains a certain number of keys. Obviously, it should allow the user to define quotas (for example, how many buckets can be created under a Volume or how much space can be used by a Bucket), which is a common requirement for storage systems.
+
+## Currently supported
+1. Storage Space level quota
+
+Administrators should be able to define how much storage space a Volume or Bucket can use.
+
+## Client usage
+### Storage Space level quota
+Storage space level quotas allow the use of units such as KB (k), MB (m), GB (g), TB (t), PB (p), etc. Represents how much storage Spaces will be used.
+
+#### Volume Storage Space level quota
+```shell
+bin/ozone sh volume create --space-quota 5MB /volume1
+```
+This means setting the storage space of Volume1 to 5MB
+
+```shell
+bin/ozone sh volume setquota --space-quota 10GB /volume1
+```
+This behavior changes the quota of Volume1 to 10GB.
+
+#### Bucket Storage Space level quota
+```shell
+bin/ozone sh bucket create --space-quota 5MB /volume1/bucket1
+```
+That means bucket1 allows us to use 5MB of storage.
+
+```shell
+bin/ozone sh bucket setquota  --space-quota 10GB /volume1/bucket1 
+```
+This behavior changes the quota for Bucket1 to 10GB
+
+A bucket quota should not be greater than its Volume quota. Let's look at an example. If we have a 10MB Volume and create five buckets under that Volume with a quota of 5MB, the total quota is 25MB. In this case, the bucket creation will always succeed, and we check the quota for bucket and volume when the data is actually written. Each write needs to check whether the current bucket is exceeding the limit and the current total volume usage is exceeding the limit.
+
+#### Clear the quota for Volume1. The Bucket cleanup command is similar.
+```shell
+bin/ozone sh volume clrquota --space-quota /volume1
+```
+
+#### Check quota and usedBytes for volume and bucket
+```shell
+bin/ozone sh volume info /volume1
+bin/ozone sh bucket info /volume1/bucket1
+```
+We can get the quota value and usedBytes in the info of volume and bucket.
\ No newline at end of file
diff --git a/hadoop-hdds/docs/content/feature/Quota.zh.md b/hadoop-hdds/docs/content/feature/Quota.zh.md
new file mode 100644
index 0000000..9cdb221
--- /dev/null
+++ b/hadoop-hdds/docs/content/feature/Quota.zh.md
@@ -0,0 +1,67 @@
+---
+title: "Ozone中的配额"
+date: "2020-October-22"
+weight: 4
+summary: Ozone中的配额
+icon: user
+---
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+ 目前,我们知道Ozone允许用户创建Volume,Bucket和Key。一个Volume通常包含几个Bucket,每个Bucket也包含一定数量的Key。显然,它应该允许用户定义配额(例如,在一个Volume下可以创建多少个Bucket或一个Bucket可以使用多少空间),这是存储系统的常见要求。
+## 目前支持的
+1. Storage space级别配额
+
+ 管理员应该能够定义一个Volume或Bucket可以使用多少存储空间。
+
+## 客户端用法
+### Storage space级别配额
+ Storage space级别配额允许使用 KB(k),MB(m),GB(g),TB(t), PB(p)等单位。表示将使用多少个存储空间。
+#### Volume Space quota用法
+```shell
+bin/ozone sh volume create --space-quota 5MB /volume1
+```
+ 这意味着将volume1的存储空间设置为5MB
+
+```shell
+bin/ozone sh volume setquota --space-quota 10GB /volume1
+```
+ 此行为将volume1的配额更改为10GB。
+
+#### Bucket Space quota 用法
+```shell
+bin/ozone sh bucket create --space-quota 5MB /volume1/bucket1
+```
+ 这意味着bucket1允许我们使用5MB的存储空间。
+
+```shell
+bin/ozone sh bucket setquota  --space-quota 10GB /volume1/bucket1 
+```
+ 该行为将bucket1的配额更改为10GB
+
+一个bucket配额 不应大于其Volume的配额。让我们看一个例子,如果我们有一个10MB的Volume,并在该Volume下创建5个Bucket,配额为5MB,则总配额为25MB。在这种情况下,创建存储桶将始终成功,我们会在数据真正写入时检查bucket和volume的quota。每次写入需要检查当前bucket的是否超上限,当前总的volume使用量是否超上限。
+
+#### 清除Volume1的配额, Bucket清除命令与此类似
+```shell
+bin/ozone sh volume clrquota --space-quota /volume1
+```
+#### 查看volume和bucket的quota值以及usedBytes
+```shell
+bin/ozone sh volume info /volume1
+bin/ozone sh bucket info /volume1/bucket1
+```
+我们能够在volume和bucket的info中查看quota及usedBytes的值


---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-commits-help@hadoop.apache.org