手机版
你好,游客 登录 注册
背景:
阅读新闻

Nutch 1.3和Hadoop 0.20.203.0的整合

[日期:2011-10-22] 来源:Linux社区  作者:ybb123456789 [字体:大 中 小]

一、Hadoop的安装。 http://www.linuxidc.com/Linux/2011-10/45730.htm

二、Nutch1.3的下载安装

svn co http://svn.apache.org/repos/asf/nutch/branches/branch-1.3/  ~/nutch

也可以直接在http://labs.renren.com/apache-mirror//nutch/ 上下载,我下的是1.3版本。

三、修改conf/下的nutch-site.xml

  1. <configuration>  
  2. <property>  
  3.   <name>http.agent.name</name>  
  4.   <value>HD nutch agent</value>  
  5.   <description>HTTP 'User-Agent' request header. MUST NOT be empty -  
  6.   please set this to a single word uniquely related to your organization.  
  7.   </description>  
  8. </property>  
  9.    
  10. <property>  
  11.   <name>http.robots.agents</name>  
  12.   <value>HD nutch agent</value>  
  13.   <description>The agent strings we'll look for in robots.txt files,  
  14.   comma-separated, in decreasing order of precedence. You should  
  15.   put the value of http.agent.name as the first agent name, and keep the  
  16.   default * at the end of the list. E.g.: BlurflDev,Blurfl,*  
  17.   </description>  
  18. </property>   
  19. </configuration> 

四、将hadoop中conf下的所有文件考到nutch的conf下。

五、用ant重新编译Nutch,如果ant没安装apt-get install ant可以直接安装~

注:如果没有重新编译,对于nutch-site.xml的修改是无效的,会出现Nutch Fetcher: No agents listed in ‘http.ag          ent.name’ property的错误

六、进入到runtime/deploy/bin下:

./nutch crawl hdfs://localhost:9000/user/fzuir/urls.txt -dir hdfs://localhost:9000/user/fzuir/crawled -depth 3 -topN    10

这个时候,还会报一个错误:

NullPointerException at org.apache.nutch.fetcher.FetcherOutputFormat.checkOutputSpecs.

这个是因为Nutch1.3的一个bug,在Nutch的官网上有提到在1.4的版本上有修改,但是1.4还么有发布,所有就根 据官网的提示自己改下两个java文件,然后重新编译下:

linux
相关资讯       Hadoop  Nutch 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款