Namenode recovery
In this recipe, we will cover how to recover Namenode from corrupted edits
or fsimage
. During the Namenode startup, the edits
is check pointed into the fsimage
image . What if the image is corrupted? Will the Namenode boot up?
In a worst-case scenario, it recovers as much data as possible and removes any corrupted entries from metadata so that the Namenode can start up.
Getting ready
For this recipe, make sure you have completed the recipe on Hadoop cluster setup, Chapter 1, Hadoop Architecture and Deployment, and have at least HDFS running perfectly.
How to do it...
Connect to the
master1.cyrus.com
master node and switch to userhadoop
.While attempting to start the Namenode, it just fails with bad or corrupted blocks and we have no way to bring the Namenode up.
Remember we cannot run
fsck
if Namenode is not running.As a last resort, we will try to skip the missing or corrupted metadata and start the Namenode with a cleaner image.
To start the Namenode recover process, use the...