In Hadoop version 0.20.1, There is a Bug,namenode synchronization failure in 0.21.0, current Produced a edits.new, and Fsimage synchronization with the exception, and Secondnamenode also produced the same directory structure and data, and reported the following exception:
Our secondary name node was not able to start on NullPointerException:
ERROR org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode:java.lang.NullPointerException
At Org.apache.hadoop.hdfs.server.namenode.FSDirectory.unprotectedSetTimes (fsdirectory.java:1232)
At Org.apache.hadoop.hdfs.server.namenode.FSDirectory.unprotectedSetTimes (fsdirectory.java:1221)
At Org.apache.hadoop.hdfs.server.namenode.FSEditLog.loadFSEdits (fseditlog.java:776)
At Org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSEdits (fsimage.java:992)
At
Org.apache.hadoop.hdfs.server.namenode.secondarynamenode$checkpointstorage.domerge (SecondaryNameNode.java:590)
At
org.apache.hadoop.hdfs.server.namenode.secondarynamenode$checkpointstorage.access$000 (SecondaryNameNode.java : 473)
At Org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.doMerge (secondarynamenode.java:350)
At Org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.doCheckpoint (secondarynamenode.java:314)
At Org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.run (secondarynamenode.java:225)
At Java.lang.Thread.run (thread.java:619)
This is caused by setting access time on a non-existent file.
To modify the Hadoop source code:
index:src/hdfs/org/apache/hadoop/hdfs/server/namenode/fsdirectory.java======================================== ===========================---src/hdfs/org/apache/hadoop/hdfs/server/namenode/fsdirectory.java (revision 823221) + + + Src/hdfs/org/apache/hadoop/hdfs/server/namenode/fsdirectory.java (working copy) @@ -33,6 +33,7 @@ -33,6 Org.apache.hadoop.hdfs.protocol.QuotaExceededException; Import org.apache.hadoop.hdfs.server.common.HdfsConstants.StartupOption; Import Org.apache.hadoop.hdfs.server.namenode.blocksmap.blockinfo;+import Org.mortbay.log.Log; /************************************************* * Fsdirectory Stores the filesystem directory state.@@ -1218,6 +1219 , @@ boolean unprotectedsettimes (String src, long mtime, Long atime, Boolean force) THR oWS IOException {Inodefile inode = Getfileinode (src); + if (inode = = null) {+ NameNode.stateChangeLog.warn ("DI r* fsdirectory.unprotectedsettimes: "+ +" failed to Settimes "+ src +"Because source does not exist "): + Return false;+} return unprotectedsettimes (SRC, inode, mtime, atime, Force) ; }
Start Namenode newspaper NullPointerException