Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here. Want to know more about what has changed? Check out the Community News blog.

How to start Namenode If edits logs got corrupt ?

How to start Namenode If edits logs got corrupt ?

New Contributor
ERRORorg.apache.hadoop.hdfs.server.namenode.EditLogInputStream
caught exception initializing /OPT1/dfs/nn/current/edits_0000000000001367225-0000000000001367335
org.apache.hadoop.hdfs.server.namenode.EditLogFileInputStream$LogHeaderCorruptException: Reached EOF when reading log header
 at org.apache.hadoop.hdfs.server.namenode.EditLogFileInputStream.readLogVersion(EditLogFileInputStream.java:269)
 at org.apache.hadoop.hdfs.server.namenode.EditLogFileInputStream.init(EditLogFileInputStream.java:101)
 at org.apache.hadoop.hdfs.server.namenode.EditLogFileInputStream.nextOpImpl(EditLogFileInputStream.java:135)
 at org.apache.hadoop.hdfs.server.namenode.EditLogFileInputStream.nextOp(EditLogFileInputStream.java:183)
 at org.apache.hadoop.hdfs.server.namenode.EditLogInputStream.readOp(EditLogInputStream.java:74)
 at org.apache.hadoop.hdfs.server.namenode.FSEditLogLoader.loadEditRecords(FSEditLogLoader.java:138)
 at org.apache.hadoop.hdfs.server.namenode.FSEditLogLoader.loadFSEdits(FSEditLogLoader.java:93)
 at org.apache.hadoop.hdfs.server.namenode.FSImage.loadEdits(FSImage.java:685)
 at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImage(FSImage.java:641)
 at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:246)
 at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFSImage(FSNamesystem.java:498)
 at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:390)
 at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:354)
 at org.apache.hadoop.hdfs.server.namenode.NameNode.loadNamesystem(NameNode.java:389)
 at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:423)
 at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:590)
 at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:571)
 at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1134)
 at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1193)
May 23 2014 10:51 AMERRORorg.apache.hadoop.hdfs.server.namenode.FSImage
Error replaying edit log at offset 0.  Expected transaction ID was 1367225
org.apache.hadoop.hdfs.server.namenode.EditLogFileInputStream$LogHeaderCorruptException: Reached EOF when reading log header
 at org.apache.hadoop.hdfs.server.namenode.EditLogFileInputStream.readLogVersion(EditLogFileInputStream.java:269)
 at org.apache.hadoop.hdfs.server.namenode.EditLogFileInputStream.init(EditLogFileInputStream.java:101)
 at org.apache.hadoop.hdfs.server.namenode.EditLogFileInputStream.nextOpImpl(EditLogFileInputStream.java:135)
 at org.apache.hadoop.hdfs.server.namenode.EditLogFileInputStream.nextOp(EditLogFileInputStream.java:183)
 at org.apache.hadoop.hdfs.server.namenode.EditLogInputStream.readOp(EditLogInputStream.java:74)
 at org.apache.hadoop.hdfs.server.namenode.FSEditLogLoader.loadEditRecords(FSEditLogLoader.java:138)
 at org.apache.hadoop.hdfs.server.namenode.FSEditLogLoader.loadFSEdits(FSEditLogLoader.java:93)
 at org.apache.hadoop.hdfs.server.namenode.FSImage.loadEdits(FSImage.java:685)
 at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImage(FSImage.java:641)
 at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:246)
 at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFSImage(FSNamesystem.java:498)
 at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:390)
 at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:354)
 at org.apache.hadoop.hdfs.server.namenode.NameNode.loadNamesystem(NameNode.java:389)
 at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:423)
 at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:590)
 at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:571)
 at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1134)
 at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1193)
1 REPLY 1

Re: How to start Namenode If edits logs got corrupt ?

Master Guru
Hello,

You can try to configure your dfs.namenode.name.dir in hdfs-site.xml, and attempt a recovery as described at http://blog.cloudera.com/blog/2012/05/namenode-recovery-tools-for-the-hadoop-distributed-file-system...