How to Move or Change HDFS DataNode Directories
Requirement:
Currently we have /hadoop/hdfs/data and /hadoop/hdfs/data1 as datanode directories.
I have new mountpoint (/hadoop/hdfs/data/datanew) with faster disk and I want to keep only this mountpoint as datanode directory.
Steps:
- Stop the cluster.
- Go to the ambari HDFS configuration and edit the datanode directory configuration: Remove /hadoop/hdfs/data and /hadoop/hdfs/data1. Add /hadoop/hdfs/datanew save.
- Login into each datanode VM and copy the contents of /data and /data1 into /datanew
- Change the ownership of /datanew and everything under it to “hdfs”.
- Start the cluster.

