Volume and bucket management using ofs
When using ofs
, Ozone administrators and users can perform various
volume and bucket operations with the help of the Hadoop shell commands such as creating
volumes and buckets and using ACLs on the volumes and buckets.
Creating volumes and buckets
Ozone administrators can create directories under the root and first-level directories using the Hadoop shell. Creating a directory under the root is equivalent to creating an Ozone volume. Creating a directory under a first-level directory is equivalent to creating a bucket. In addition, Ozone users can create buckets under volumes to which they have the write access.
volume1
using
the -mkdir
command of the Hadoop
shell:ozone fs -mkdir ofs://ozservice1/volume1/
ozone sh volume create o3://ozservice1/volume1/
ozone fs -mkdir ofs://ozservice1/volume1/bucket1/
Using the /tmp
directory
The ofs
root contains a special tmp
volume mount
for backward compatibility with legacy Hadoop applications that use the
/tmp/
directory. To use the volume mount, the Ozone
administrator must first create a tmp
volume and set its Access
Control List (ACL) to ALL. This administrator needs to perform this process once for
every cluster.
tmp
volume and assign
it the required
ACLs:ozone sh volume create tmp
ozone sh volume setacl tmp -al world::a
tmp
volume, each user must
initialize their respective tmp
bucket once. The following example
shows how to initialize the tmp
bucket.ozone fs -mkdir ofs://ozservice1/tmp/
The user can then write to the /tmp/
bucket just as they would to a
regular bucket.
Using ACLs on volumes and buckets
- Setting ACLs on a first-level directory except
/tmp/
is the same as setting ACLs on a volume. - Setting ACLs on a second-level directory is the same as setting ACLs on a bucket.
- The ACLs on the
/tmp/
directory are the same as those on the bucket from which the/tmp/
directory is mapped.For example, if you mapofs:///tmp/
fromofs:///tmp/<tmp-bucket-for-current-user>/
, the ACLs onofs:///tmp/<tmp-bucket-for-current-user>/
are the same as those onofs:///tmp/bucket1/
. - You cannot set ACLs on the root (
/
) because it is only a logical root.
Renaming volumes and buckets
The
ofs
file system does not support renaming of volumes and
buckets. Any attempt to rename a volume or a bucket results in an exception. You can
only rename directories inside a bucket.
For example, ofs
supports renaming of ofs:///volume1/bucket1/dir1
to
ofs:///volume1/bucket1/dir2
.