Setting up o3fs
Select the Ozone bucket to configure o3fs
and add specific properties
to core-site.xml
.
-
Select the Ozone bucket on which you want
o3fs
to reside.If you do not have a designated volume or bucket foro3fs
, create them using the required commands:ozone sh volume create /volume ozone sh bucket create /volume/bucket
-
Add the properties
fs.o3fs.impl
andfs.default.name
tocore-site.xml
.Adding these properties makes the bucket as the default file system for HDFSdfs
commands and registers theo3fs
file system type.<property> <name>fs.o3fs.impl</name> <value>org.apache.hadoop.fs.ozone.OzoneFileSystem</value> </property> <property> <name>fs.defaultFS</name> <value>o3fs://bucket.volume.OzoneServiceId</value> </property>
-
Add the
ozone-filesystem-hadoop3.jar
to the classpath.export HADOOP_CLASSPATH=/opt/ozone/share/ozonefs/lib/hadoop-ozone-filesystem-hadoop3-*.jar:$HADOOP_CLASSPATH
After setting upo3fs
, you can runhdfs
commands such as the following on Ozone:hdfs dfs -ls /
hdfs dfs -mkdir /users
Now, applications such as Hive and Spark can run on this file system after some basic configuration changes.