Volume and bucket management using ofs
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.
-mkdircommand of the Hadoop shell:
ozone fs -mkdir ofs://ozservice1/volume1/
ozone sh volume create o3://ozservice1/volume1/
ozone fs -mkdir ofs://ozservice1/volume1/bucket1/
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
tmpvolume and assign it the required ACLs:
ozone sh volume create tmp ozone sh volume setacl tmp -al world::a
tmpvolume, each user must initialize their respective
tmpbucket once. The following example shows how to initialize the
ozone fs -mkdir ofs://ozservice1/tmp/
The user can then write to the
/tmp/ bucket just as they would to a
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 map
o3fs:///tmp/<tmp-bucket-for-current-user>/, the ACLs on
ofs:///tmp/<tmp-bucket-for-current-user>/are the same as those on
- You cannot set ACLs on the root (
/) because it is only a logical root.
Renaming volumes and buckets
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.
supports renaming of