【发布时间】:2016-06-13 04:35:58
【问题描述】:
我有一个关于 ElasticSearch 和 Apache Nutch 集成的问题。
我已尝试遵循此处列出的 Nutch+ES 指南
https://gist.github.com/xrstf/b48a970098a8e76943b9
https://qbox.io/blog/scraping-the-web-with-nutch-for-elasticsearch
和
http://www.aossama.com/search-engine-with-apache-nutch-mongodb-and-elasticsearch/
具体来说,我能够设置HDFS+HBase+Nutch并爬取一个页面列表(我可以确认数据确实被爬取并存储在HBase的网页表中)。
我也可以让 ElasticSearch 和 Kibana 正常工作(成功创建新索引并插入一些记录,确认可以使用 Kibana)
但是,我无法让他们的组合发挥作用。基本上,我在 Nutch 上执行了以下命令后:
nutch inject <file_containing_url>
nutch generate -topN 1
nutch fetch -all
nutch parse -all
nutch updatedb -all
现在,我想将获取的数据索引到 ES 中,我按照指南进行操作:
nutch index elasticsearch -all
但是,在此命令执行完成后,ElasticSearch 中没有任何变化。 runtime/local/logs 下的日志显示:
elastic.ElasticIndexWriter - Processing remaining requests [docs = 0, length = 0, total docs = 0]
这让我相信 ES 根本不需要 nutch 索引任何东西。
整个过程我哪里做错了?我必须指定一些关于 ES 的东西来 nutch 吗?
仅供参考:以下是一些操作系统/工具的详细信息: CentOS 6.7、HBase 1.1.3 弹性搜索 1.7.5、Nutch 2.3.1。 我已修改 nutch-site.xml 以包含 ES 的属性:
<property>
<name>plugin.includes</name>
<!-- do **NOT** enable the parse-html plugin, if you want proper HTML parsing. Use something like parse-tika! -->
<value>protocol-httpclient|urlfilter-regex|parse-(text|tika|js)|index-(basic|anchor|more)|query-(basic|site|url)|response-(json|xml)|summary-basic|scoring-opic|urlnormalizer-(pass|regex|basic)|indexer-elastic</value>
</property>
<property>
<name>elastic.host</name>
<value>10.5.140.112</value> <!-- where is ElasticSearch listening -->
</property>
<property>
<name>elastic.cluster</name>
<value>nutch</value>
</property>
<property>
<name>elastic.index</name>
<value>nutch</value>
</property>
<property>
<name>elastic.port</name>
<value>9300</value>
</property>
非常感谢大家的帮助!
【问题讨论】:
标签: elasticsearch nutch bigdata