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
o3fsto 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.implandfs.default.nametocore-site.xml.Adding these properties makes the bucket as the default file system for HDFSdfscommands and registers theo3fsfile 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.jarto the classpath.export HADOOP_CLASSPATH=/opt/ozone/share/ozonefs/lib/hadoop-ozone-filesystem-hadoop3-*.jar:$HADOOP_CLASSPATHAfter setting upo3fs, you can runhdfscommands 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.
