Home Forums HDFS Namenode Failure Recovery

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

  • Creator
    Topic
  • #34677

    Swapnil Patil
    Participant

    Hi..
    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 (dfs.name.dir) 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 logged in to reply to this topic.

  • Author
    Replies
  • #44788

    Koelli Mungee
    Moderator

    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 dfs.name.dir 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 dfs.name.dir 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 dfs.name.dir.

    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.

    Regards
    Koelli

    Collapse
    #44088

    Sorna Lingam
    Member

    HI Seth,

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

    Thanks
    Sornalingam

    Collapse
    #39160

    Seth Lyubich
    Keymaster

    Hi Swapnil,

    You can try setting up HA solutions that we support (see docs.hortonworks.com). If you need to setup NameNode on your secondary NameNode you will need to reconfigure you NameNode directories to point to SNN directories, reconfigure fs.default.name 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.

    Thanks,
    Seth

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