Nutch 1.13 + Solr 5.5.4統合FAQ

3032 ワード

詳細
1.Elastic searchの情報が見つかりません
nutch 1が構成する.13とSolr 5.5.4以降、solrを使用してnutchが登った結果をインデックスし、elastic searchがあるかどうかをエラーで表示します.
Zhuos-MacBook-Pro:apache-nutch-1.13 jo$ nutch solrindex http://localhost:8983/solr/~/nutch/crawl/crawldb -linkdb ~/nutch/crawl/linkdb -dir ~/nutch/crawl/segments
...
Indexer: java.lang.RuntimeException: Missing elastic.cluster and elastic.host. At least one of them should be set in nutch-site.xml 
ElasticIndexWriter
elastic.cluster : elastic prefix cluster
elastic.host : hostname
elastic.port : port
elastic.index : elastic index command 
elastic.max.bulk.docs : elastic bulk index doc counts. (default 250)
elastic.max.bulk.size : elastic bulk index length in bytes. (default 2500500)
elastic.exponential.backoff.millis : elastic bulk exponential backoff initial delay in milliseconds. (default 100)
elastic.exponential.backoff.retries : elastic bulk exponential backoff max retries. (default 10)
elastic.bulk.close.timeout : elastic timeout for the last bulk in seconds. (default 600
 
解決方法:indexerがelasticとして指定されているためです.nutch-siteを変更します.xmlはこの問題を解決します.
plugin.includesのvalueノード値indexer-elasticをindexer-solrに変更すればよい.修正後は次のようになります.

  plugin.includes
  protocol-http|urlfilter-regex|parse-(html|tika)|index-(basic|anchor)|indexer-solr|scoring-opic|urlnormalizer-(pass|regex|basic)
  Regular expression naming plugin directory names to
  include.  Any plugin not matching this expression is excluded.
  In any case you need at least include the nutch-extensionpoints plugin. By
  default Nutch includes crawling just HTML and plain text via HTTP,
  and basic indexing and search plugins. In order to use HTTPS please enable 
  protocol-httpclient, but be aware of possible intermittent problems with the 
  underlying commons-httpclient library. Set parsefilter-naivebayes for classification based focused crawler.
  

 
2)solrindex時報の間違いJob failed.nutch solrindexエラー404405などを実行する.
Indexer: java.io.IOException: Job failed!
at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:865)
at org.apache.nutch.indexer.IndexingJob.index(IndexingJob.java:147)
at org.apache.nutch.indexer.IndexingJob.run(IndexingJob.java:230)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
 
at org.apache.nutch.indexer.IndexingJob.main(IndexingJob.java:239)
 
解決方法:nutchのlogディレクトリの下のエラーを表示して、バックグラウンドがsolrのページが404405などの情報を返したためであることを発見します.
これらはnutch solrindexを実行するときに指定したsolrアドレスが正しくないためエラーです.
僕らはhttp://localhost:8983/solr后ろにcoreの名前を直接つけて、#をつけないで、つけないで~cores/ディレクトリ..
たとえばmycoreというcoreを自分で作成した場合、nutch sollindexコマンドは次のように実行されます.
nutch solrindex http://localhost:8983/solr/mycore ~/nutch/crawl/crawldb -linkdb ~/nutch/crawl/linkdb -dir ~/nutch/crawl/segments