當打開開啓HDFS後,上傳的時候卻遇到如下問題:
put: File /user/hadoop/input/XGBD.xlsx._COPYING_ could only
be replicated to 0 nodes instead of minReplication (=1).
There are 1 datanode(s) running and no node(s) are excluded
in this operation.
對此,可能是之前格式化出現了問題,對於這種現象先查看進程是否正常。
hadoop@zsz-VirtualBox:/usr/local/hadoop$ jps
2912 DataNode
3329 ResourceManager
3491 NodeManager
2757 NameNode
3128 SecondaryNameNode
4381 Jps
可以看出基本沒有問題,那就針對格式化問題,進行格式化後重啓,看看是否可以解決問題。
利用命令:./bin/hdfs namenode -format
hadoop@zsz-VirtualBox:/usr/local/hadoop$ ./bin/hdfs namenode -format
...
...
...
20/03/24 14:13:38 INFO namenode.NNStorageRetentionManager: Going to retain 1 images with txid >= 0
20/03/24 14:13:38 INFO util.ExitUtil: Exiting with status 0
20/03/24 14:13:38 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at zsz-VirtualBox/127.0.1.1
************************************************************/
格式化完之後,重新輸入之前想上傳的文件,這個時候就會上傳成功了。
以上是針對個人遇到問題的解決方法,遇到這種問題也可能是其他錯誤,這這裏就不詳細說明啦。