I. Installed Hadoop, unable to restart after restarting or multiple formatting Datanode
The following error message appears by viewing the log:
2013-07-09 21:02:28,129 INFO org.apache.hadoop.hdfs.server.datanode.DataNode:PacketResponder 0 for block Blk_ 4652602677290140246_1188 terminating
2013-07-09 21:05:52,576 INFO Org.apache.hadoop.hdfs.server.datanode.DataBlockScanner:Verification succeeded for Blk_ 4652602677290140246_1188
2013-07-09 21:12:37,713 WARN Org.apache.hadoop.hdfs.server.datanode.DataNode:java.io.IOException:Call to long1657-06/192.168.0.6:9000 failed on local exception:java.io.EOFException
At Org.apache.hadoop.ipc.Client.wrapException (client.java:775)
At Org.apache.hadoop.ipc.Client.call (client.java:743)
At Org.apache.hadoop.ipc.rpc$invoker.invoke (rpc.java:220)
At Com.sun.proxy. $Proxy 4.sendHeartbeat (Unknown Source)
At Org.apache.hadoop.hdfs.server.datanode.DataNode.offerService (datanode.java:702)
At Org.apache.hadoop.hdfs.server.datanode.DataNode.run (datanode.java:1186)
At Java.lang.Thread.run (thread.java:724)
caused by:java.io.EOFException
At Java.io.DataInputStream.readInt (datainputstream.java:392)
At Org.apache.hadoop.ipc.client$connection.receiveresponse (client.java:501)
At Org.apache.hadoop.ipc.client$connection.run (client.java:446)
Two. Why the problem occurs
When we perform file system formatting, a current/version file is saved in the Namenode Data folder (that is, in the configuration file Dfs.name.dir the path to the local system), the Namespaceid is recorded, the formatted Version of Namenode. If we format the Namenode frequently, then the Datanode is saved (that is, the path Dfs.data.dir the local system in the configuration file) current/ The version file is just the Namespaceid of the namenode that you saved at the first time you formatted it, resulting in a namespaceid inconsistency between Datanode and Namenode.
Iii. Solutions
Change the Namespaceid in the configuration file to current/version in the path of the local system to the same as Namenode. Dfs.data.dir.
If not, you can dfs.data.dir the specified directory in Namenode,datanode to recreate, and then format it in Namenode: Hadoop namenode-format
Start Hadoop to start the Datanode node.