Depending on whether you are an administrator or an individual user, the Ozone shell
commands enable you to create, delete, view, list, and update volumes. 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 volume and specifying quota
Only an administrator can create a volume and assign it to a user. You must assign
administrator privileges to users before they can create volumes.
Creating a volume:
Command Syntax
ozone sh volume create [--namespace-quota=<quotaInNamespace>]
[--space-quota=<quotaInBytes>] <uri>
Command Usage
Create volume with only space quota:
ozone sh volume create --space–quota=<quotaInBytes> <uri>
Create volume with only namespace
quota:
ozone sh volume create --namespace-quota=<quotaInNamespace> <uri>
Create volume with both space and namespace quota:
ozone sh volume create --namespace-quota=<quotaInNamespace> --space–quota=<quotaInBytes> <uri>
Purpose
Creates a volume with the quota.
Arguments
--namespace-quota: Specify the number of buckets in a volume. This is an
optional parameter.
--space-quota: Specifies the maximum size the volume can occupy in the
cluster. This is an optional parameter.
uri: The name of the volume to create in the
<prefix>://<Service ID>/<volumename>
format.
Examples
ozone sh volume create --space-quota=2TB o3://ozone1/vol1
This
command creates a 2 TB volume named vol1. Here, ozone1 is the Ozone Service
ID.
ozone sh volume create --namespace-quota=100 o3://ozone1/vol1
This
command sets the namespace quota of vol1 to 100.
Checking namespace and space quota for volume
Command Syntax
ozone sh volume info <uri>
Purpose
Get the quota value and usedNamespace info of the volume.
Arguments
uri: The name of the volume whose details you want to view, in the
<prefix>://<Service ID>/<volumename> format.
Example
ozone sh volume info o3://ozone1/vol1
This command gets the quota value and usedNamespace of
vol1.