The Hortonworks Community Connection is now live. A completely rebuilt Q&A forum, Knowledge Base, Code Hub and more, backed by the experts in the industry.

You will be redirected here in 10 seconds. If your are not redirected, click here to visit the new site.

The legacy Hortonworks Forum is now closed. You can view a read-only version of the former site by clicking here. The site will be taken offline on January 31,2016

HDFS Forum

Namenode Failure Recovery

  • #34677
    Swapnil Patil

    If my namenode fails how would it recover from secondary namenode?
    I have set up (fs.checkpoint.dir) property in Secondary namenode’s hdfs-site.xml file.. But when i start namenode with
    -importcheckpoint option ,namenode doesnt take files from SNN’s checkpoint directory..
    what could be the issue?
    Do I have to set up (fs.checkpoint.dir) in Namenode’s hdfs-site.xml file?
    when i give multiple paths in ( property.. and start the namenode with -importcheckpoint option everything works well.. But I want namenode to fetch the edits log and image file from SNN..
    How should I do it?
    Thanks inadvance..

  • Author
  • #39160
    Seth Lyubich

    Hi Swapnil,

    You can try setting up HA solutions that we support (see If you need to setup NameNode on your secondary NameNode you will need to reconfigure you NameNode directories to point to SNN directories, reconfigure to be on SNN node host, and HTTP address to point to SNN as well.

    These are general steps. Please let me know if this is helpful. Please also consider that there might be a potential data loss between check pointing interval.


    Sorna Lingam

    HI Seth,

    Can you kindly provide me the steps to recover the name node ?


    Koelli Mungee

    Hi Sorna

    What is the scenario you are facing? Is is a namenode directory corruption? In the non-HA case for HDP 1.3.x, if it is a namenode directory corruption you can try this:

    1. If you have more that one NameNode directory copies on your NameNode machine, one of those could be valid. In this case, remove the corrupted one from the list of NameNode data dirs via property in hdfs-site.xml and start NameNode. It should start normally.
    2. If there is no valid copy of NameNode data directory on NameNode machine, you should use Secondary NameNode to perform recovery:

    The appropriate way to recover from the checkpoint copies is to do the following:

    1. Create on your new NameNode (it must be empty)
    2. Make sure fs.checkpoint.dir is pointed at your last known good copy
    3. Start the NameNode with the -importCheckpoint option
    4. The NameNode will verify that the files in fs.checkpoint.dir are consistent and create a new copy of the FsImage and EditLog in

    Your NameNode should start functioning again and will exit safemode once the appropriate number of blocks have been reported. The NameNode will not alter the files in fs.checkpoint.dir.


The forum ‘HDFS’ is closed to new topics and replies.

Support from the Experts

A HDP Support Subscription connects you experts with deep experience running Apache Hadoop in production, at-scale on the most demanding workloads.

Enterprise Support »

Become HDP Certified

Real world training designed by the core architects of Hadoop. Scenario-based training courses are available in-classroom or online from anywhere in the world

Training »

Hortonworks Data Platform
The Hortonworks Data Platform is a 100% open source distribution of Apache Hadoop that is truly enterprise grade having been built, tested and hardened with enterprise rigor.
Get started with Sandbox
Hortonworks Sandbox is a self-contained virtual machine with Apache Hadoop pre-configured alongside a set of hands-on, step-by-step Hadoop tutorials.
Modern Data Architecture
Tackle the challenges of big data. Hadoop integrates with existing EDW, RDBMS and MPP systems to deliver lower cost, higher capacity infrastructure.