一、ElasticSearch安装
详细步骤参考: https://www.jianshu.com/p/15d31cf30154
1、官网下载对应的压缩包.
2、安装.
安装中会遇到两个问题:
(1)、Linux文件句柄数不足.
(2)、Linux内存过小.
都在上面的网页中可以得到答案.
二、ES使用教程
1、走http方式存储查询数据
(1)、谷歌下载个应用PostMan可以操作读写ES.
(2)、
2、ES和Hive集成
(1)、下载elasticsearch-hadoop-hive-6.2.4.jar包, 放到Hive_Home/lib下.(集群所有机器都要放)
(2)、下载commons-httpclient-3.1.jar包, 放到Hive_Home/lib下.(集群所有机器都要放)
(3)、创建Hive外部表(从这开始就走不通)
DROP TABLE IF EXISTS tmp_stu_es ;
create external table tmp_stu_es(
id string,
type string,
unit string,
qty string
)
STORED BY "org.elasticsearch.hadoop.hive.EsStorageHandler"
TBLPROPERTIES(
"es.nodes" = "ip1:9200,ip2:9200,ip3:9200",
"es.mapping.id" = "id",
"es.index.auto.create" = "true",
"es.resource" = "tmp_stu_es_index(就是es中展示的index的名字)/tmp_stu_es_type((就是es中展示的type的名字))",
"es.mapping.names" = "type:type,unit:unit,qty:qty",
"es.write.operation"="upsert"
);
本文详细介绍了Elasticsearch的安装步骤,包括解决Linux文件句柄数不足及内存过小的问题。此外,还提供了ES与Hive集成的教程,涉及下载必要jar包、配置Hive外部表等内容。

1055

被折叠的 条评论
为什么被折叠?



