Remove or add storage directories for NameNode data directories

This is a cluster administration task where existing Namenode DataDir must be changed. Perform the following steps to change the Namenode directories with downtime.

  1. Take a backup of the existing DataDir paths on NNs. For instance, for each NN, if there are two DataDir paths, taking backup of one DataDir is sufficient.
  2. Create new mounts where the Namenode data will reside and ensure the permissions and ownerships are all same as that of the old Namenode data directories.
  3. Shutdown the Standby Namenode.
  4. Log in to the host and copy the NN DataDir content from old mount to new mount.
  5. Verify the permission and ownership of fsimage* edits* VERSION files.
  6. Navigate to Cloudera Manager > HDFS > Instances > click on the SBNN role (stopped one) > Configuration > search for dfs.namenode.name.dir > change the mount path to new one > Save Changes
  7. Start the SBNN NameNode.
  8. Wait for the SBNN to start and is out of safe mode.
  9. Navigate to Cloudera Manager > HDFS > Configuration > Federation and High Availability > Actions > Manual Failover > select SBNN option > click Manual Failover > wait until the failover is complete.
  10. You must verify using the NN webUIs if the previous SBNN node is now the ANN and ANN node is now the SBNN.
  11. Repeat steps 2-7 on the new SBNN which was previous ANN.