Hadoop2.6的DataNode啟動不了

獵手家園發表於2016-05-08
2016-05-04 18:14:51,990 INFO org.apache.hadoop.ipc.Server: IPC Server Responder: starting
2016-05-04 18:14:51,990 INFO org.apache.hadoop.ipc.Server: IPC Server listener on 50020: starting
2016-05-04 18:14:52,219 INFO org.apache.hadoop.hdfs.server.common.Storage: Lock on /home/hadoopuser/hadoop-2.6.0-cdh5.6.0/tmp/dfs/data/in_use.lock acquired by nodename 53036@Hadoop-DN-01
2016-05-04 18:14:52,220 WARN org.apache.hadoop.hdfs.server.common.Storage: java.io.IOException: Incompatible clusterIDs in /home/hadoopuser/hadoop-2.6.0-cdh5.6.0/tmp/dfs/data: namenode clusterID = CID-1dc853da-6e7a-41a3-b7aa-65e66100891a; datanode clusterID = CID-f8a918d0-3b61-4b83-a7b4-796e490ec780
2016-05-04 18:14:52,220 FATAL org.apache.hadoop.hdfs.server.datanode.DataNode: Initialization failed for Block pool <registering> (Datanode Uuid unassigned) service to Hadoop-NN-01/192.168.107.82:9000. Exiting.

 

從日誌上看,加粗的部分說明了問題:

datanode的clusterID 和 namenode的clusterID 不匹配。

解決辦法:

根據日誌中的路徑,cd /home/hadoop/tmp/dfs

能看到 data和name兩個資料夾,

將name/current下的VERSION中的clusterID複製到data/current下的VERSION中,覆蓋掉原來的clusterID

讓兩個保持一致

 

然後重啟,啟動後執行jps,檢視程式

20131 SecondaryNameNode

20449 NodeManager

19776 NameNode

21123 Jps

19918 DataNode

20305 ResourceManager

 

出現該問題的原因:在第一次格式化dfs後,啟動並使用了hadoop,後來又重新執行了格式化命令(hdfs namenode -format),這時namenode的clusterID會重新生成,而datanode的clusterID 保持不變。

 

相關文章