Apache Nutch 2.3.1,增加减速机内存

问题描述 投票:0回答:1

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

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

hadoop web-crawler nutch nutch2
1个回答
0
投票

最后,我找到了解决方案。 NutchJob做到了目标。以下是代码段

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
© www.soinside.com 2019 - 2024. All rights reserved.