Nutch报错和解决方法

Indexer: java.io.IOException: Job failed!

环境:nutch1.8  local模式 solr服务正常

ParseSegment: finished at 2014-07-14 21:21:19, elapsed: 00:00:35
CrawlDB update
CrawlDb update: starting at 2014-07-14 21:21:21
CrawlDb update: db: crawl/crawldb
CrawlDb update: segments: [crawl/segments/20140714190910]
CrawlDb update: additions allowed: true
CrawlDb update: URL normalizing: false
CrawlDb update: URL filtering: false
CrawlDb update: 404 purging: false
CrawlDb update: Merging segment data into db.
CrawlDb update: finished at 2014-07-14 21:21:30, elapsed: 00:00:09
Link inversion
LinkDb: starting at 2014-07-14 21:21:33
LinkDb: linkdb: crawl/linkdb
LinkDb: URL normalize: true
LinkDb: URL filter: true
LinkDb: internal links will be ignored.
LinkDb: adding segment: crawl/segments/20140714190910
LinkDb: merging with existing linkdb: crawl/linkdb
LinkDb: finished at 2014-07-14 21:21:42, elapsed: 00:00:09
Dedup on crawldb
Indexing 20140714190910 on SOLR index -> http://192.168.122.104:8080/solr
Indexer: starting at 2014-07-14 21:21:55
Indexer: deleting gone documents: false
Indexer: URL filtering: false
Indexer: URL normalizing: false
Active IndexWriters :
SOLRIndexWriter
        solr.server.url : URL of the SOLR instance (mandatory)
        solr.commit.size : buffer size when sending to SOLR (default 1000)
        solr.mapping.file : name of the mapping file for fields (default solrindex-mapping.xml)
        solr.auth : use authentication (default false)
        solr.auth.username : use authentication (default false)
        solr.auth : username for authentication
        solr.auth.password : password for authentication


Indexer: java.io.IOException: Job failed!
        at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:1357)
        at org.apache.nutch.indexer.IndexingJob.index(IndexingJob.java:114)
        at org.apache.nutch.indexer.IndexingJob.run(IndexingJob.java:176)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
        at org.apache.nutch.indexer.IndexingJob.main(IndexingJob.java:186)

解决方法: 

1、查看nutch日志发现是nutch在向solr请求的时候有Bad Request导致的

2、查看solr日志(在solr的web页面上的logging)中查看找到org.apache.solr.common.SolrException: ERROR: [doc=http://18.ifeng.com/] unknown field 'anchor'

3、从2中可以看出是缺少叫做'anchor'的field,那么在solr的solr/collection1/conf/schema.xml文件中增加'anchor'字段

No agents listed in 'http.agent.name' property

原因:$NUTCH_HOME/conf/nutch-site.xml中没有设置http.agent.name值,nutch较新版本(TODO:确切版本待考证)中这个值为空的话就会报这个错误。

解决:这个值其实就是User-Agent值,可以填写浏览器UA值以达到伪装成浏览器访问的目的。注意!填写后需使用ant重新编译才能生效。




转载于:https://my.oschina.net/paddy0826/blog/290591

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值