Backing up and recovering Namenode
In this recipe, we will look at how to backup and restore Namenode. As discussed previously, the importance of backup, despite having high availability, will cover some ways to restore the backup. The backup could be as simple as just a copy of the metadata to the other system and then copying it back on the new node and starting the Namenode process or using the import command to point to the backup location and executing the command to copy the contents to the right location with the right permissions.
Getting ready
For this recipe, you will again need a running cluster with HDFS configured in the cluster. Readers are recommended to read the previous recipes in this chapter to understand this recipe better.
How to do it...
Connect to the
master1.cyrus.com
master node and switch to userhadoop
.For backup, copy the contents of the directory pointed by
dfs.namenode.name.dir
to any other location, preferably outside the system. This could be doing a simplescp...