elasticsearch,sandbox,Hadoop,elasticsearch,Sandbox" /> elasticsearch,sandbox,Hadoop,elasticsearch,Sandbox" />

如何在Hadoop上配置弹性搜索?

如何在Hadoop上配置弹性搜索?,hadoop,elasticsearch,sandbox,Hadoop,elasticsearch,Sandbox,我想在hadoop和hive上配置弹性搜索。弹性搜索在我的本地机器上运行,Hadoop在另一台机器上运行。我使用的是沙盒HDP版本2.2。我如何配置它?沙盒中是否提供了任何UI?这些是在hadoop上配置弹性搜索的步骤 步骤1 创建一个要添加数据的表 CREATE TABLE logs (type STRING, time STRING, ext STRING, ip STRING, req STRING, res INT, bytes INT, phpmem INT, agent STRING

我想在hadoop和hive上配置弹性搜索。弹性搜索在我的本地机器上运行,Hadoop在另一台机器上运行。我使用的是沙盒HDP版本2.2。我如何配置它?沙盒中是否提供了任何UI?

这些是在hadoop上配置弹性搜索的步骤

步骤1

创建一个要添加数据的表

CREATE TABLE logs (type STRING, time STRING, ext STRING, ip STRING, req STRING, res INT, bytes INT, phpmem INT, agent STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t';
步骤2

向表中添加数据(这里是一个日志文件apache.log)

步骤3

将Jar文件添加到类路径中(注意版本2.1.0.BUILD-SNAPSHOT.Jar)

步骤4

创建要在localhosts elasticsearch中使用的eslogs表

CREATE EXTERNAL TABLE eslogs (time STRING, extension STRING, clientip STRING, request STRING, response INT, agent STRING)
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler' TBLPROPERTIES('es.resource' = 'test/test','es.mapping.names' = 'time:@timestamp', 'es.nodes' = 'IP_ON_WHICH_ELASTICSEARCH_IS_RUNNING:9200');
步骤5

将数据添加到eslogs from logs表中

INSERT OVERWRITE TABLE eslogs SELECT s.time, s.ext, s.ip, s.req, s.res, s.agent FROM logs s;

我写了一系列关于集成Elasticsearch和Apache Spark的博客文章。所以这不是一个精确的匹配,但它可能会给你一些想法。以下是本系列的第三部分(链接到前面的部分),关于部署:
CREATE EXTERNAL TABLE eslogs (time STRING, extension STRING, clientip STRING, request STRING, response INT, agent STRING)
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler' TBLPROPERTIES('es.resource' = 'test/test','es.mapping.names' = 'time:@timestamp', 'es.nodes' = 'IP_ON_WHICH_ELASTICSEARCH_IS_RUNNING:9200');
INSERT OVERWRITE TABLE eslogs SELECT s.time, s.ext, s.ip, s.req, s.res, s.agent FROM logs s;