首页 > 解决方案 > 无法写入 HDFS:WARN hdfs.DataStreamer - Unexpected EOF

问题描述

我正在学习教程,在单个集群测试环境中运行时,我突然无法运行任何 MR 作业或将数据写入 HDFS。之前效果很好,突然我一直低于错误(重新启动没有帮助)。

我可以从 HDFS 读取和删除文件,但不能写入。

$ hdfs dfs -put war-and-peace.txt /user/hands-on/

19/03/25 18:28:29 WARN hdfs.DataStreamer: Exception for BP-1098838250-127.0.0.1-1516469292616:blk_1073742374_1550
java.io.EOFException: Unexpected EOF while trying to read response from server
    at org.apache.hadoop.hdfs.protocolPB.PBHelperClient.vintPrefixed(PBHelperClient.java:399)
    at org.apache.hadoop.hdfs.protocol.datatransfer.PipelineAck.readFields(PipelineAck.java:213)
    at org.apache.hadoop.hdfs.DataStreamer$ResponseProcessor.run(DataStreamer.java:1020)
put: All datanodes [DatanodeInfoWithStorage[127.0.0.1:50010,DS-b90326de-a499-4a43-a66a-cc3da83ea966,DISK]] are bad. Aborting...

“hdfs dfsadmin -report”显示一切都很好,有足够的磁盘空间。我几乎没有做任何工作,只是一些测试 MR 和少量测试数据。

$ hdfs dfsadmin -report
Configured Capacity: 52710469632 (49.09 GB)
Present Capacity: 43335585007 (40.36 GB)
DFS Remaining: 43334025216 (40.36 GB)
DFS Used: 1559791 (1.49 MB)
DFS Used%: 0.00%
Under replicated blocks: 0
Blocks with corrupt replicas: 0
Missing blocks: 0
Missing blocks (with replication factor 1): 0
Pending deletion blocks: 0

-------------------------------------------------
Live datanodes (1):

Name: 127.0.0.1:50010 (localhost)
Hostname: localhost
Decommission Status : Normal
Configured Capacity: 52710469632 (49.09 GB)
DFS Used: 1559791 (1.49 MB)
Non DFS Used: 6690530065 (6.23 GB)
DFS Remaining: 43334025216 (40.36 GB)
DFS Used%: 0.00%
DFS Remaining%: 82.21%
Configured Cache Capacity: 0 (0 B)
Cache Used: 0 (0 B)
Cache Remaining: 0 (0 B)
Cache Used%: 100.00%
Cache Remaining%: 0.00%
Xceivers: 2
Last contact: Mon Mar 25 18:30:45 EDT 2019

NameNode WebUI(端口 50070)也显示一切正常,日志也没有报告任何错误。它可能是什么/我该如何正确排除故障?

CentOS Linux 6.9 最小 Apache Hadoop 2.8.1

标签: hadoophdfs

解决方案


推荐阅读