【问题标题】:MapReduce Multiple Outputs: File Could Only Be Replicated to 0 Nodes, Instead of 1MapReduce 多输出:文件只能复制到 0 个节点,而不是 1 个
【发布时间】:2015-07-23 14:45:42
【问题描述】:

我有一个 Reduce 作业,我收到上述错误,文件只能复制到 0 个节点而不是 1 个。我在网上搜索过,发现这可能是数据节点的问题,但我正在运行此工作流中的其他 MapReduce 作业都在工作。我看到的唯一区别是我使用了多个输出并指定了一个文件夹,但我确信路径是正确的。这是多输出写入行:

mos.write("mosName", new LongWritable(key), value, outputFilePath);

我得到的确切错误是:

org.apache.hadoop.ipc.RemoteException(java.io.IOException): File xxx could 
only be replicated to 0 nodes instead of minReplication (=1).  There are 7 
datanode(s) running and no node(s) are excluded in this operation.

任何帮助将不胜感激。

【问题讨论】:

    标签: java hadoop mapreduce


    【解决方案1】:

    我遇到了同样的问题,当我将输出写入上下文而不是 MultipleOutputs 时,它没有复制。据我所知,这是由于 MultipleOutputs 在内存中保存更多数据的时间更长。

    解决方案是:

    (1) 对输出进行压缩

    FileOutputFormat.setCompressOutput(job, true);
    FileOutputFormat.setOutputCompressorClass(job, GzipCodec.class);
    

    (2) 为我的工作提供更多内存(请记住,java.opts 中的 JVM 内存最多必须占容器内存的 80%)

    -Dmapreduce.map.memory.mb=3072 -Dmapreduce.map.java.opts=-Xmx2048m
    

    【讨论】:

      猜你喜欢
      • 2013-03-13
      • 1970-01-01
      • 1970-01-01
      • 2011-07-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多