问题:
dfs中可以创建目录不可以上传文件
报错XXX could only be written to 0 of the 1 minReplication nodes,there are 0 datanode(s) running and no node(s) are excluded in this operation.
原因:
hadoop找不到DataNode
解决方案:
1、找到usr/local/hadoop/tmp/dfs/data目录
2、删除current文件
3、执行hadoop namenode -format命令
4、执行start-dfs.sh和start-yarn.sh命令
5、重新创建目录:执行hdfs dfs -mkdir -p /user/hadoop和hdfs dfs -mkdir input命令
6、重新上传文件:hdfs dfs -put XXX input