Generally, users do not have to define mount tables or the core-site.xml to use the mount table. This is done by operations and the correct configuration is set on the right gateway machines as is done forcore-site.xml today.
The mount tables can be described in core-site.xml but it is better to use indirection incore-site.xml to reference a separate configuration file, say mountTable.xml. Add the following configuration element tocore-site.xml for referencing mountTable.xml:
<configuration xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="mountTable.xml" />
</configuration>
In the file mountTable.xml, there is a definition of the mount table "ClusterX" for the hypothetical cluster that is a federation of the three namespace volumes managed by the three namenodes
- nn1-clusterx.example.com:8020,
- nn2-clusterx.example.com:8020, and
- nn3-clusterx.example.com:8020.
Here /home and /tmp are in the namespace managed by namenode nn1-clusterx.example.com:8020, and projects/foo and /bar are hosted on the other namenodes of the federated cluster. The home directory base path is set to/home so that each user can access its home directory using the getHomeDirectory() method defined inFileSystem/FileContext.
<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./projects/foo</name>
<value>hdfs://nn2-clusterx.example.com:8020/projects/foo</value>
</property>
<property>
<name>fs.viewfs.mounttable.ClusterX.link./projects/bar</name>
<value>hdfs://nn3-clusterx.example.com:8020/projects/bar</value>
</property>
</configuration>
refer:http://hadoop.apache.org/docs/r2.4.0/hadoop-project-dist/hadoop-hdfs/ViewFs.html