这篇文章主要介绍了Nutch报错怎么办,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。
环境:nutch2.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'字段
原因:$NUTCH_HOME/conf/nutch-site.xml中没有设置http.agent.name值,nutch较新版本(TODO:确切版本待考证)中这个值为空的话就会报这个错误。
解决:这个值其实就是User-Agent值,可以填写浏览器UA值以达到伪装成浏览器访问的目的。注意!填写后需使用ant重新编译才能生效。
感谢你能够认真阅读完这篇文章,希望小编分享的“Nutch报错怎么办”这篇文章对大家有帮助,同时也希望大家多多支持亿速云,关注亿速云行业资讯频道,更多相关知识等着你来学习!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。