Commands for managing buckets
The Ozone shell commands enable you to create, delete, view, and list buckets. Before running these commands, you must have configured the Ozone Service ID for your cluster from the Configuration tab of the Ozone service on Cloudera Manager.
Creating bucket and specifying quota
Command Syntax |
ozone sh bucket create [--namespace-quota=<quotaInNamespace>] [--space-quota=<quotaInBytes>] <uri> |
Command Usage |
|
Purpose | Creates a bucket with the quota. |
Arguments |
|
Example | ozone sh bucket create --space-quota=2TB o3://ozone1/vol1/buck1This command creates a 2 TB bucket named buck1. Here, ozone1 is the Ozone Service ID. ozone sh bucket create --namespace-quota=100 o3://ozone1/vol1/buck1This command sets the namespace quota of buck1 to 100. |
Checking Namespace and space quota for bucket
Command Syntax |
ozone sh bucket info <uri> |
Purpose | Get the quota value, usedNamespace , and
usedBytes info of the bucket. |
Arguments | uri: The name of the bucket you want to view in the
<prefix>://<Service ID>/<volumename>/<bucketname>
format. |
Example | ozone sh bucket info o3://ozone1/vol1/buck1This command gets the quota value, usedNamespace , and
usedBytes of buck1.{ "metadata" : { }, "volumeName" : "vol1", "name" : "buck1", "storageType" : "DISK", "versioning" : false, "usedBytes" : 0, "usedNamespace" : 0, "creationTime" : "2023-07-10T06:12:47.270Z", "modificationTime" : "2023-07-10T06:12:47.270Z", "sourcePathExist" : true, "quotaInBytes" : 1099511627776, "quotaInNamespace" : 100, "bucketLayout" : "LEGACY", "owner" : "user1", "link" : false } |
Setting namespace and space level quota for bucket
Namespace quota is a number that represents how many unique names can be used. This number cannot be greater than LONG.MAX_VALUE in Java.
Command Syntax |
ozone sh bucket setquota [-hV] [--namespace-quota=<quotaInNamespace>][--space-quota=<quotaInBytes>] <uri> |
Command Usage |
|
Purpose |
|
Arguments |
|
Example |
|
Clearing namespace and space quota for bucket
Command Syntax |
ozone sh bucket clrquota [-hV] [--namespace-quota] [--space-quota] <uri> |
Command Usage |
|
Purpose |
|
Arguments |
|
Example |
|