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.
- 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.
- 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.
- Shutdown the Standby Namenode.
- Log in to the host and copy the NN DataDir content from old mount to new mount.
- Verify the permission and ownership of fsimage* edits* VERSION files.
- 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
- Start the SBNN NameNode.
- Wait for the SBNN to start and is out of safe mode.
- 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.
- You must verify using the NN webUIs if the previous SBNN node is now the ANN and ANN node is now the SBNN.
- Repeat steps 2-7 on the new SBNN which was previous ANN.