【发布时间】:2016-06-24 09:36:22
【问题描述】:
我已经阅读了此页面和其他相关链接,以便在 hadoop 上安装和配置 elasticsearch。 Install and Configure elasticsearch on hadoop?
但是,我仍然没有一些问题。
我分别使用 elasticsearch 和 spark/hadoop;具体来说,我正在使用 cloudera hadoop,而 elasticsearch 正在其他 linux 机器上运行。 在 hadoop 中,我有一个边缘节点来提交一个 spark 作业,并且该作业通过带有配置的执行器在其他 6 个节点上运行。
- 下面的这个安装指南对我来说没有太多的信息。
(1) 当我在每个节点上安装 elasticsearch-hadoop 二进制文件时,Elasticsearch 会在 HDFS 上保留索引吗? (2) 如果是这样,我需要将 jar 二进制文件放在哪里? elasticsearch-spark_2.11-2.2.0.jar elasticsearch-hadoop-2.2.0.jar
实际上,使用 elasticsearch-hadoop-2.2.0.jar,我可以从运行在 linux 机器上的 elasticsearch 读取/写入文档。
sc.makeRDD(docs).saveToEs(indexname + "/" + typename, Map( "es.nodes" -> ES_HOSTN_ODE_ADDRESS, "es.port" -> ES_HOST_PORT))
(3) 我需要如何设置hdfs的数据路径? 目前elasticsearch已经配置成类似
path.data: /data1,/data2,/data3,/data4
(4) 还有其他一些好的文档/页面可以参考吗?
elasticsearch-hadoop binaries can be obtained either by downloading them from the elastic.co site as a ZIP (containing project jars, sources and documentation) or by using any Maven-compatible tool with the following dependency:
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch-hadoop</artifactId>
<version>2.2.0</version>
</dependency>
jar above contains all the features of elasticsearch-hadoop and does not require any other dependencies at runtime; in other words it can be used as is. elasticsearch-hadoop binary is suitable for both Hadoop 1.x and Hadoop 2.x (also known as YARN) environments without any changes.
-
在spark上使用scala,我可以从elasticsearch中查询文档,但是查询到的数据并没有针对每个executor进行并行化。 如果我使用 elasticsearch-hadoop 并从 hdfs 查询数据,则数据会像 parquet 文件一样自动并行化 (RDD),而无需
sc.parallelize(数据);
对我来说,推/拉大数据对于使用 Kibana 等多种工具进行可视化非常重要。 elasticsearch-hadoop对elasticsearch有什么强大的优势吗?
【问题讨论】:
标签: hadoop elasticsearch apache-spark