Created 08-03-2016 02:14 PM
Currently I have an existing cluster with Namenode HA -- I want to change the dfs.namenode.name.dir and dfs.datanode.data.dir to different from what is currently configured.
Created 08-04-2016 09:33 PM
@sgowda, thanks for confirming you just want to mount volumes at a new location. If you are just remounting then your existing HDFS metadata and data files will be present but under new Linux paths.
In that case decommissioning is not necessary. You just need to to update NameNode and DataNode configuration settings like dfs.namenode.name.dir, dfs.datanode.data.dir to point to the new locations. See this link for a full list of settings, not all may apply to you. Don't reformat the NN else you will lose all your data.
The simplest approach is:
If you are not familiar with these settings I recommend learning more about HDFS first since its easy to lose data via administrative mistakes.
Created 08-03-2016 02:36 PM
Best way to change dfs.datanode.data.dir is to decommission the datanode, change the value and add it back. This would avoid directly access files and moving them. You could move the contents from directory to another (without decommission) but not recommended.
For namenode metadata directories, you can change this value and restart standby NN first. Once Standby NN comes back (and it will start using new directory), then restart active NN. It picks the new directory on restart as well. Once both NNs are up, you can clear the contents of the older metadata directories.
Created 08-04-2016 05:08 AM
I was doing this from Ambari, after changing the directories namenode would not come up and starting complaining about namenode dir is not formated. Should I format the dir at the namenode machines ?
Created 08-03-2016 11:13 PM
Are you just mounting volumes at a new location?
Created 08-04-2016 05:05 AM
@Arpit Agarwal yes correct
Created 08-04-2016 09:33 PM
@sgowda, thanks for confirming you just want to mount volumes at a new location. If you are just remounting then your existing HDFS metadata and data files will be present but under new Linux paths.
In that case decommissioning is not necessary. You just need to to update NameNode and DataNode configuration settings like dfs.namenode.name.dir, dfs.datanode.data.dir to point to the new locations. See this link for a full list of settings, not all may apply to you. Don't reformat the NN else you will lose all your data.
The simplest approach is:
If you are not familiar with these settings I recommend learning more about HDFS first since its easy to lose data via administrative mistakes.