1、启动Hadoop后发现datanode没有启动,报如下错误:
WARN org.apache.hadoop.hdfs.server.common.Storage: Failed to add storage directory [DISK]file:/opt/hadoop/hadoop-2.7.3/hdfs/data/
java.io.IOException: Incompatible clusterIDs in /opt/hadoop/hadoop-2.7.3/hdfs/data: namenode clusterID = CID-fdc65d4a-e307-489b-acd2-dd1cd8906794; datanode clusterID = CID-254be5a5-9e38-42d6-ae59-cfeb58d258bd
应该是由于多次格式化命令所致(/opt/hadoop/hadoop-2.7.3/bin/hdfs namenode -format)
解决方法:
停止Hadoop服务,删除/opt/hadoop/hadoop-2.7.3/hdfs/data/下的所有文件,然后重新格式化,再启动就好了