Reply
New Contributor
Posts: 1
Registered: ‎09-13-2013

How to recover during namenode failure from secondary namenode ??

Hi ,

 

          I am new to Hadoop and Big data .

I have set up a five node cluster and my NN ans SNN are on two diiferent machine .

Please help me with the configuration files properties and the way to recover the namenode from secondary namenode .

 

Rgds ,

Nivedita

Posts: 416
Topics: 51
Kudos: 73
Solutions: 48
Registered: ‎06-26-2013

Re: How to recover during namenode failure from secondary namenode ??

Nivedita,

 

  There is no failover mechanism between the Namenode and the Secondary Namenode.  Prior to CDH4, there was no high availability in the NN.  As of CDH4, you can now set up HA NNs as per the doc below:

 

http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH4/latest/CDH4-High-Availability-Gu...

 

Thank you,

 

Clint

Cloudera Employee
Posts: 11
Registered: ‎09-17-2013

Re: How to recover during namenode failure from secondary namenode ??

Additionally, if you are not using HA for the Namenode, then the failover process looks like the following:

 

Recovery process:
Spin up a new NameNode - install CDH if required, add the role to a host via CM, but leave the role Stopped

 

Copy the fsimage and edits from the SNN name.dir on the local filesystem, to NN name.dir

 

[root@dn1 ~]# scp /dfs/snn/current/* nn2:/dfs/nn/current
root@nn2's password:
edits_0000000000000000001-0000000000000000004 100% 104 0.1KB/s 00:00
edits_0000000000000000005-0000000000000000078 100% 1024KB 1.0MB/s 00:00
edits_0000000000000000079-0000000000000000080 100% 30 0.0KB/s 00:00
edits_0000000000000000081-0000000000000000093 100% 1024KB 1.0MB/s 00:00
edits_0000000000000000094-0000000000000000095 100% 30 0.0KB/s 00:00
fsimage_0000000000000000080 100% 931 0.9KB/s 00:00
fsimage_0000000000000000080.md5 100% 62 0.1KB/s 00:00
fsimage_0000000000000000095 100% 931 0.9KB/s 00:00
fsimage_0000000000000000095.md5 100% 62 0.1KB/s 00:00
VERSION 100% 176 0.2KB/s 00:00

 

Start the new HDFS NN

Start the Data Nodes
Redeploy client config (if using CM)

 

You should be good to go!

Highlighted
Raw
New Contributor
Posts: 1
Registered: ‎03-31-2017

Re: How to recover during namenode failure from secondary namenode ??

Recovery:
1. Create an empty directory specified in the dfs.namenode.checkpoint.dir configuration variable.
a.mkdir -p /data/secondary_nn/dfs/namesecondary
b.chown hdfs:hadoop /data/secondary_nn/dfs/namesecondary
2. Scp fsimage and edit logs from secondary namenode to namenode's dfs.namenode.checkpoint.dir.
a.[root@hdw3 namesecondary]# pwd
b./data/secondary_nn/dfs/namesecondary
c.[root@hdw3 namesecondary]# scp -r current hdm:/data/secondary_nn/dfs/namesecondary/
3. Change owner and group on namenode
a.chown -R hdfs:hadoop /data/secondary_nn/dfs/namesecondary/*
4. Namenode import checkpint
a) hdfs namenode -importCheckpoint
5. Restart HDFS cluster

Announcements