【问题标题】:Apache Nutch 2.3.1, increase reducer memoryApache Nutch 2.3.1,增加reducer内存
【发布时间】:2019-02-12 05:27:01
【问题描述】:

如果 Hadoop 和 Hbase 用于 Nutch 2.3.1,我已经设置了一个小型集群。 hadoop 版本是 2.7.7,Hbase 是 0.98。我已经定制了一个 hadoop 作业,现在我必须在驱动程序类中为减速器任务设置内存。我了解到,在简单的 hadoop MR 工作中,您可以使用JobConf 方法setMemoryForReducer。但是 Nutch 中没有任何可用的选项。就我而言,目前,reducer 内存通过mapred-site.xml(Hadoop 配置)设置为 4 GB。但对于 Nutch,我必须加倍。

是否可以不通过驱动程序类或 nutch-site.xml 更改 hadoop conf 文件

【问题讨论】:

    标签: hadoop web-crawler nutch nutch2


    【解决方案1】:

    最后,我找到了解决方案。 NutchJob 完成目标。以下是代码sn -p

    NutchJob job = NutchJob.getInstance(getConf(), "rankDomain-update");
    
    int reducer_mem = 8192;
    String memory = "-Xmx" + (int) (reducer_mem * 0.8)+ "m";
    job.getConfiguration().setInt("mapreduce.reduce.memory.mb", reducer_mem);
    job.getConfiguration().set("mapreduce.reduce.java.opts", memory );
    // rest of code below
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多