mapreduce作业失败,出现io异常

6pp0gazn  于 2021-06-03  发布在  Hadoop
关注(0)|答案(1)|浏览(300)

我运行的是单节点hadoop环境。我有一个mapreduce作业来计算某些特定时间段内某些监视信息的平均值,例如每小时平均值。此作业将输出写入hdfs内的路径。在运行该作业之前,需要花费一定的时间进行清理。一个月来一直运转良好。昨天,在运行job时,我从jobclient得到一个异常,说:
文件/user/root/out1/\u临时/\u尝试\u 2014011141113 \u 0007 \u r\u000000 \u 0/hi/130-r-00000只能复制到0个节点,而不是1个节点
完整堆栈跟踪如下:

..........

14/01/17 12:00:09 INFO mapred.JobClient:  map 100% reduce 32%
14/01/17 12:00:12 INFO mapred.JobClient:  map 100% reduce 74%
14/01/17 12:00:17 INFO mapred.JobClient: Task Id : attempt_201401141113_0007_r_000000_0, Status : FAILED
org.apache.hadoop.ipc.RemoteException: java.io.IOException: File /user/root/out1/_temporary/_attempt_201401141113_0007_r_000000_0/hi/130-r-00000 could only be replicated to 0 nodes, instead of 1
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:1558)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.addBlock(NameNode.java:696)
    at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:563)
    at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1388)
    at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1384)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:396)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121)
    at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1382)

    at org.apache.hadoop.ipc.Client.call(Client.java:1070)
    at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:225)
    at $Proxy2.addBlock(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
    at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
    at $Proxy2.addBlock(Unknown Source)
    at org.apache.hadoop.hdfs.DFSClient$DFSOutputStream.locateFollowingBlock(DFSClient.java:3510)
    at org.apache.hadoop.hdfs.DFSClient$DFSOutputStream.nextBlockOutputStream(DFSClient.java:3373)
    at org.apache.hadoop.hdfs.DFSClient$DFSOutputStream.access$2600(DFSClient.java:2589)
    at org.apache.hadoop.hdfs.DFSClient$DFSOutputStream$DataStreamer.run(DFSClient.java:2829)

从最初在google上的搜索来看,是关于存储空间的问题。但我不这么认为,因为我的整个输入数据应该少于600mb,节点上大约有1.5gb的可用空间。我运行了hadoop dfsadmin-report命令,返回如下:

$hadoop dfsadmin -report
Configured Capacity: 11353194496 (10.57 GB)
Present Capacity: 2354425856 (2.19 GB)
DFS Remaining: 1633726464 (1.52 GB)
DFS Used: 720699392 (687.31 MB)
DFS Used%: 30.61%
Under replicated blocks: 49
Blocks with corrupt replicas: 0
Missing blocks: 0

-------------------------------------------------
Datanodes available: 1 (1 total, 0 dead)

Name: 192.168.1.149:50010
Decommission Status : Normal
Configured Capacity: 11353194496 (10.57 GB)
DFS Used: 720699392 (687.31 MB)
Non DFS Used: 8998768640 (8.38 GB)
DFS Remaining: 1633726464(1.52 GB)
DFS Used%: 6.35%
DFS Remaining%: 14.39%
Last contact: Fri Jan 17 04:36:55 GMT+05:30 2014

请给我一个解决方案。这可能是一个配置问题。我对hadoop的配置不太了解。请帮助。。

gv8xihay

gv8xihay1#

我认为,也许,你的问题实际上是一个空间问题。您有一个副本集,因此如果您的输入是600 mb,则集群上需要1.2 gb。
您仍然有300mb的空闲空间,这可能不足以在节点之间发送数据。
我的建议是使用较小的数据集来检查这是否是问题所在,大约300mb或更少。然后,如果您不以这种方式解决问题,请尝试将conf/hdfs-site.xml上的副本设置为0

<property>
    <name>dfs.replication</name>
    <value>0</value>
</property>

相关问题