设为首页 收藏本站
查看: 920|回复: 0

[经验分享] Apache Nutch 1.3 学习笔记二

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-8-1 13:56:21 | 显示全部楼层 |阅读模式
1. Nutch 1.3 运行命令的一些介绍
     要看Nutch的命令说明,可执行如下命令bin/nutch
  


  • Usage: nutch [-core] COMMAND  

  •     where COMMAND is one of:  

  •     crawl             one-step crawler for intranets  

  •     readdb            read / dump crawl db  

  •     convdb            convert crawl db from pre-0.9 format  

  •     mergedb           merge crawldb-s, with optional filtering  

  •     readlinkdb        read / dump link db  

  •     inject            inject new urls into the database  

  •     generate          generate new segments to fetch from crawl db  

  •     freegen           generate new segments to fetch from text files  

  •     fetch             fetch a segment's pages  

  •     parse             parse a segment's pages  

  •     readseg           read / dump segment data  

  •     mergesegs         merge several segments, with optional filtering and slicing  

  •     updatedb          update crawl db from segments after fetching  

  •     invertlinks       create a linkdb from parsed segments  

  •     mergelinkdb       merge linkdb-s, with optional filtering  

  •     solrindex         run the solr indexer on parsed segments and linkdb  

  •     solrdedup         remove duplicates from solr  

  •     solrclean         remove HTTP 301 and 404 documents from solr  

  •     plugin            load a plugin and run one of its classes main()  

  •    or  

  •     CLASSNAME         run the class named CLASSNAME  

  • Most commands print help when invoked w/o parameters.  



  • Expert: -core option is for developers only. It avoids building the job jar,   

  •         instead it simply includes classes compiled with ant compile-core.   

  •         NOTE: this works only for jobs executed in 'local' mode  
  
2. 单个命令的说明
2.1 bin/nutch crawl
  Usage: Crawl  -solr  [-dir d] [-threads n] [-depth i] [-topN N]
这是用于对urls进行一键式抓取的命令
2.2 bin/nutch readdb
  Usage: CrawlDbReader  (-stats | -dump  | -topN   [] | -url )
这是用于对crawldb数据库进行读取的命令,主要是用于dump相应的url文件
2.3 bin/nutch convdb
  这个命令主要用于把nutch 0.9的crawldb数据转换成1.3的格式
2.4 bin/nutch mergedb
  Usage: CrawlDbMerger   [  ...] [-normalize] [-filter]
这个命令主要用于合并多个crawldb数据库
2.5 bin/nutch readlinkdb
  Usage: LinkDbReader  {-dump  | -url )
主要用于读取invertlinks产生的链接数据
2.6 bin/nutch inject
  Usage: Injector  
主要用于把url_dir中的url注入到crawldb数据库中去
2.7 bin/nutch generate
  Usage: Generator   [-force] [-topN N] [-numFetchers numFetchers] [-adddays numDays] [-noFilter] [-noNorm][-maxNumSegments num]
用于产生准备抓取的url列表
2.8 bin/nutch freegen
  Usage: FreeGenerator   [-filter] [-normalize]
从文本文件中提取urls来产生新的抓取segment
2.9 bin/nutch fetch
  Usage: Fetcher  [-threads n] [-noParsing]
主要用来对generate产生的urls进行抓取,这里用到了Hadoop架构,使用了一个FetcherOutputFormat来对其结果进行多目录输出
2.10 bin/nutch parse
  Usage: ParseSegment segment
主要是对抓取的内容进行分析
2.11 bin/nutch readseg
  Usage: SegmentReader (-dump ... | -list ... | -get ...) [general options]
这个命令主要是输出segment的内容
2.12 bin/nutch invertlinks
  Usage: LinkDb  (-dir  |   ...) [-force] [-noNormalize] [-noFilter]
这个命令主要是得到抓取内容的外链接数据
2.13 bin/nutch solrindex
  Usage: SolrIndexer    ( ... | -dir )
对抓以的内容进行索引建立,前提是要有solr环境。
2.14 bin/nutch plugin
  Usage: PluginRepository pluginId className [arg1 arg2 ...]
这个命令主要对插件进行测试,运行其main方法
  
  作者:http://blog.iyunv.com/amuseme_lu
  
  
  
  相关文章阅读及免费下载:
  
  Apache Nutch 1.3 学习笔记目录
  
  Apache Nutch 1.3 学习笔记一
  
  Apache Nutch 1.3 学习笔记二
  
  Apache Nutch 1.3 学习笔记三(Inject)
  
  Apache Nutch 1.3 学习笔记三(Inject CrawlDB Reader)
  
  Apache Nutch 1.3 学习笔记四(Generate)
  
  Apache Nutch 1.3 学习笔记四(SegmentReader分析)
  
  Apache Nutch 1.3 学习笔记五(FetchThread)
  
  Apache Nutch 1.3 学习笔记五(Fetcher流程)
  
  Apache Nutch 1.3 学习笔记六(ParseSegment)
  
  Apache Nutch 1.3 学习笔记七(CrawlDb - updatedb)
  
  Apache Nutch 1.3 学习笔记八(LinkDb)
  
  Apache Nutch 1.3 学习笔记九(SolrIndexer)
  
  Apache Nutch 1.3 学习笔记十(Ntuch 插件机制简单介绍)
  
  Apache Nutch 1.3 学习笔记十(插件扩展)
  
  Apache Nutch 1.3 学习笔记十(插件机制分析)
  
  Apache Nutch 1.3 学习笔记十一(页面评分机制 OPIC)
  
  Apache Nutch 1.3 学习笔记十一(页面评分机制 LinkRank 介绍)
  
  Apache Nutch 1.3 学习笔记十二(Nutch 2.0 的主要变化)
  
  更多《Apache Nutch文档》,尽在开卷有益360 http://www.docin.com/book_360
  

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-93062-1-1.html 上篇帖子: Apache Server 负载均衡 下篇帖子: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNe
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表