Scaling Namespaces and Optimizing Data Storage
Also available as:
PDF
loading table of contents...

Example of ViewFs mount table entries

You can specify the ViewFs mount table entries for a cluster in a separate configuration file and reference the file using XInclude in core-site.xml.

Consider a cluster named ClusterX for which the configuration file containing ViewFs mount table entries is referenced as follows:

<configuration xmlns:xi="http://www.w3.org/2001/XInclude"> 
  <xi:include href="mountTable.xml"/>
</configuration> 
Assume ClusterX to be a federation of three NameNodes that host different directories as specified:
  • nn1-clusterx.example.com:8020: /home and /tmp
  • nn2-clusterx.example.com:8020: /foo
  • nn3-clusterx.example.com:8020: /bar
In addition, the home directory base path is set to /home.
The following example contains the ViewFs mount table entries for the federated cluster ClusterX:
<configuration>
  <property>
    <name>fs.viewfs.mounttable.ClusterX.homedir</name>
    <value>/home</value>
  </property>
  <property>
    <name>fs.viewfs.mounttable.ClusterX.link./home</name>
    <value>hdfs://nn1-clusterx.example.com:8020/home</value>
  </property>
  <property>
    <name>fs.viewfs.mounttable.ClusterX.link./tmp</name>
    <value>hdfs://nn1-clusterx.example.com:8020/tmp</value>
  </property>
  <property>
    <name>fs.viewfs.mounttable.ClusterX.link./foo</name>
    <value>hdfs://nn2-clusterx.example.com:8020/foo</value>
  </property>
  <property>
    <name>fs.viewfs.mounttable.ClusterX.link./bar</name>
    <value>hdfs://nn3-clusterx.example.com:8020/bar</value>
  </property>
</configuration>