[hodp@nameNode sbin]$ ./start-dfs.sh
dataNode启动服务闪退,日志文件中错误
java.io.IOException: Incompatible clusterIDs in /home/hodp/dfs/data: namenode clusterID = CID-3a02cd0c-7477-48ec-bdf2-62b0049d7201; datanode clusterID = CID-ed555d51-c6eb-443e-8251-abd73d15cd9f
at org.apache.hadoop.hdfs.server.datanode.DataStorage.doTransition(DataStorage.java:723)
at org.apache.hadoop.hdfs.server.datanode.DataStorage.loadStorageDirectory(DataStorage.java:287)
at org.apache.hadoop.hdfs.server.datanode.DataStorage.loadDataStorage(DataStorage.java:400)
at org.apache.hadoop.hdfs.server.datanode.DataStorage.addStorageLocations(DataStorage.java:380)
at org.apache.hadoop.hdfs.server.datanode.DataStorage.recoverTransitionRead(DataStorage.java:545)
at org.apache.hadoop.hdfs.server.datanode.DataNode.initStorage(DataNode.java:1630)
at org.apache.hadoop.hdfs.server.datanode.DataNode.initBlockPool(DataNode.java:1590)
at org.apache.hadoop.hdfs.server.datanode.BPOfferService.verifyAndSetNamespaceInfo(BPOfferService.java:329)
at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.connectToNNAndHandshake(BPServiceActor.java:276)
at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.run(BPServiceActor.java:787)
at java.lang.Thread.run(Thread.java:748)
2017-04-29 16:22:51,882 ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: Initialization failed for Block pool <registering> (Datanode Uuid f96ca135-f04c-4026-b54c-472bc71f259b) service to nameNode/129.16.10.23:9000. Exiting.
java.io.IOException: All specified directories are failed to load.
at org.apache.hadoop.hdfs.server.datanode.DataStorage.recoverTransitionRead(DataStorage.java:546)
at org.apache.hadoop.hdfs.server.datanode.DataNode.initStorage(DataNode.java:1630)
at org.apache.hadoop.hdfs.server.datanode.DataNode.initBlockPool(DataNode.java:1590)
at org.apache.hadoop.hdfs.server.datanode.BPOfferService.verifyAndSetNamespaceInfo(BPOfferService.java:329)
at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.connectToNNAndHandshake(BPServiceActor.java:276)
at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.run(BPServiceActor.java:787)
at java.lang.Thread.run(Thread.java:748)
2017-04-29 16:22:51,889 WARN org.apache.hadoop.hdfs.server.datanode.DataNode: Ending block pool service for: Block pool <registering> (Datanode Uuid f96ca135-f04c-4026-b54c-472bc71f259b) service to nameNode/129.16.10.23:9000
2017-04-29 16:22:51,911 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: Removed Block pool <registering> (Datanode Uuid f96ca135-f04c-4026-b54c-472bc71f259b)
2017-04-29 16:22:53,912 WARN org.apache.hadoop.hdfs.server.datanode.DataNode: Exiting Datanode
2017-04-29 16:22:53,918 INFO org.apache.hadoop.util.ExitUtil: Exiting with status 0
2017-04-29 16:22:53,940 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: SHUTDOWN_MSG:
解决办法:
方法1:停掉集群 stop-all.sh,删除问题节点的data目录下的所有内容。即hdfs-site.xml文件中配置的dfs.data.dir目录。重新格式化namenode。bin/hadoop namenode -format
方法2:停掉集群 stop-all.sh,然后将datanode节点目录/dfs/data/current/VERSION中的修改为与namenode一致即可