【发布时间】:2017-02-14 13:13:55
【问题描述】:
我正在运行 Nutch 2.3.1、Mongodb 3.2.9 和 Elasticsearch 2.4.1。我遵循了本教程的混合:
https://qbox.io/blog/scraping-the-web-with-nutch-for-elasticsearch
本教程:
http://www.aossama.com/search-engine-with-apache-nutch-mongodb-and-elasticsearch/
为了使用上述 3 款软件创建一个网络爬虫工具。
一切都很好,直到它归结为索引......只要我使用来自 nutch 的 index 命令:
# bin/nutch index elasticsearch -all
发生这种情况:
IndexingJob: starting
Active IndexWriters :
ElasticIndexWriter
elastic.cluster : elastic prefix cluster
elastic.host : hostname
elastic.port : port (default 9300)
elastic.index : elastic index command
elastic.max.bulk.docs : ealstic bulk index doc counts. (default 250)
elastic.max.bulk.size : elastic bulk index length. (default 2500500 ~2.5MB)
IndexingJob: done.
我的 nutch-site.xml:
<configuration>
<property>
<name>storage.data.store.class</name>
<value>org.apache.gora.mongodb.store.MongoStore</value>
<description>Default class for storing data</description>
</property>
<property>
<name>http.agent.name</name>
<value>AOssama Crawler</value>
</property>
<property>
<name>plugin.includes</name>
<value>protocol-(http|httpclient)|urlfilter-regex|index-(basic|more)|query-(basic|site|url|lang)|indexer-elastic|nutch-extensionpoints|parse-(text|html|msexcel|msword|mspowerpoint|pdf)|summary-basic|scoring-opic|urlnormalizer-(pass|regex|basic)|parse-(html|tika|metatags)|index-(basic|anchor|more|metadata)</value>
</property>
<property>
<name>elastic.host</name>
<value>localhost</value>
</property>
<property>
<name>elastic.cluster</name>
<value>aossama</value>
</property>
<property>
<name>elastic.index</name>
<value>nutch</value>
</property>
<property>
<name>parser.character.encoding.default</name>
<value>utf-8</value>
</property>
<property>
<name>http.content.limit</name>
<value>6553600</value>
</property>
</configuration>
我还查看了 ElasticIndexWriter.java 代码并注意到在第 250 行附近调用 ElasticIndexWriter 的类。我现在正在进一步研究,但我完全不知道为什么这不适用于 Mongo。我即将放弃并尽可能多地尝试使用 Hbase。
谢谢!
乔
【问题讨论】:
-
你可以试试这个脚本吗 :: bin/crawl -i
。它完成所有任务,包括索引 -
好的,直到索引任务:跳过索引任务:没有提供 SOLR url。
-
您是否在配置中为 solr 提供了有效的 url?
-
我没有使用 Solr。我正在尝试使用 nutch 内置的 ElasticIndexWriter 来使用 Elasticsearch。
-
使用 bin/nutch 索引 crawldb_location -linkdb linkdb_location -dir segments_dir OR bin/crawl -i seed_directory crawldb_location number_of_rounds
标签: mongodb elasticsearch nutch