你好,游客 登录 注册 搜索
背景:
阅读新闻

Nutch2.1分布式抓取

[日期:2014-01-25] 来源:Linux社区  作者:flying_all [字体:大 中 小]

在这篇的基础上http://www.linuxidc.com/Linux/2014-01/95796.htm。

1准备环境:Hadoop集群、java、mysql数据库,代码可以在eclipse中运行,可以单机模式下插入数据到mysql数据库。

2修改配置文件nutch-site.xml:

<property>

  <name>plugin.folders</name>

  <value>./plugins</value>

  <description>Directories where nutch plugins are located.  Each

  element may be a relative or absolute path.  If absolute, it is used

  as is.  If relative, it is searched for on the classpath.</description>

</property>

在eclipse中选中buil.xml,run as ant,运行runtime,运行成功会产生文件夹runtime。

3 把runtime文件夹上传到hadoop集群中的master服务器(没有验证其他服务器是不是可以),我上传之后的位置是:/home/hadoop/nutch/runtime,设置环境变量:

在/etc/profile中:export NUTCH_HOME=/home/hadoop/nutch/runtime/local  source /etc/profile使得修改起作用。

4应该是把url种子文件上传到hadoop。我的种子文件始终没有成功,这一步略过。

5在/home/hadoop/nutch/runtime/deploy目录下运行:

./bin/nutch crawl  -dir crawl -depth 2 -threads 4 -topN 50

一点心得:nutch2之后不需要把配置文件(conf)分发到集群中的每台机器,但是修改配置文件以后需要重新用ant打包,配置才能生效。

Nutch的详细介绍:请点这里
Nutch的下载地址:请点这里

相关阅读:

Nutch2.0完全分布式部署配置 http://www.linuxidc.com/Linux/2012-10/71977.htm

Nutch-2.0集群配置 http://www.linuxidc.com/Linux/2012-10/71976.htm

Nutch1.7学习笔记:基本环境搭建及使用 http://www.linuxidc.com/Linux/2013-11/92891.htm

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

       

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