Namenode Failure Recovery

to create new topics or reply. | New User Registration

This topic contains 3 replies, has 4 voices, and was last updated by  Koelli Mungee 1 year, 3 months ago.

  • Creator
  • #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..

Viewing 3 replies - 1 through 3 (of 3 total)

You must be to reply to this topic. | Create Account

  • Author
  • #44788

    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.



    Sorna Lingam

    HI Seth,

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



    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.


Viewing 3 replies - 1 through 3 (of 3 total)
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.