I had this to start with in core-site.xml:
<configuration>
<property>
<name>fs.defaultFS</name>
<value>viewfs:///</value>
</property>
<property>
<name>fs.viewfs.mounttable.default.link./user</name>
<value>hdfs://hdfsuser/user</value>
</property>
<property>
<name>fs.viewfs.mounttable.default.link./preprod</name>
<value>hdfs://hdfspreprod/preprod</value>
</property>
<property>
<name>fs.viewfs.mounttable.default.link./tmp</name>
<value>hdfs://hdfsuser/tmp</value>
</property>
And this in hdfs-site.xml
<configuration>
<!-- the logical name for nameservice -->
<property>
<name>dfs.nameservices</name>
<value>hdfsuser,hdfspreprod</value>
</property>
I could list the three mount points just fine
-bash-4.1$ hadoop fs -ls /
Found 3 items
-r-xr-xr-x - hdfs hdfs 0 2016-06-30 17:34 /preprod
-r-xr-xr-x - hdfs hdfs 0 2016-06-30 17:34 /tmp
-r-xr-xr-x - hdfs hdfs 0 2016-06-30 17:34 /user
Now I would like to add the forth mount point /var so I added this to the core-site.xml
<property>
<name>fs.viewfs.mountable.default.link./var</name>
<value>hdfs://hdfsuser/var</value>
</property>
I then mkdir /var for the hdfs://hdfsuser and here are the list of directories on both namespaces.
-bash-4.1$ hadoop fs -ls hdfs://hdfsuser/
Found 4 items
drwxrwxr-t - hdfs hadoop 0 2016-05-25 14:51 hdfs://hdfsuser/prod_hdfs_namespace
drwxrwxrwt - hdfs hdfs 0 2016-07-05 14:31 hdfs://hdfsuser/tmp
drwxrwxr-x - hdfs hadoop 0 2016-05-25 15:06 hdfs://hdfsuser/user
drwxr-xr-x - hdfs hadoop 0 2016-07-05 14:40 hdfs://hdfsuser/var
-bash-4.1$ hadoop fs -ls hdfs://hdfspreprod/
Found 2 items
drwxrwxr-t - hdfs hadoop 0 2016-05-24 21:36 hdfs://hdfpreprod/preprod
drwxrwxr-t - hdfs hadoop 0 2016-05-25 14:51 hdfs://hdfspreprod/preprod_hdfs_namespace
I then restarted all of my Namenodes, and then Datanodes but on my any nodes in the cluster I could not see the /var directory.
Wed Jul 6 10:57:08 PDT 2016
-bash-4.1$ hadoop fs -ls /
Found 3 items
-r-xr-xr-x - hdfs hdfs 0 2016-07-06 10:57 /preprod
-r-xr-xr-x - hdfs hdfs 0 2016-07-06 10:57 /tmp
-r-xr-xr-x - hdfs hdfs 0 2016-07-06 10:57 /user
I googled and I could not find anything to show what are the steps to do after you already set up the federated HDFS and want to add new directory to viewfs.
Please suggest ways to fix this or the ways to correctly add a new viewfs mount point.
Thank you very much.