基于Elasticsearch的HBase大数据二级索引方案

2020-04-14 04:54:29李传冰
电脑知识与技术 2020年4期
关键词:数据库机制

摘要:HBase一直是大数据领域常用的非关系型数据库。随着HBase数据库中存入的数据量不断增长,对数据库里的数据进行查询变得越来越困难,需要有一个合理的二级索引的方案提高查询的效率。Elasticsearch是一个高性能的搜索服务器,利用Elasticsearch的技术,存储并搜索二级索引可以極大地提高HBase查询效率。

关键词:大数据;HBase;二级索引;协处理器;Elasticsearch

中图分类号:TP392

文献标识码:A

文章编号:1009-3044(2020)04-0001-02

收稿日期:2019-11-18

作者简介:李传冰(1993—),男,湖北武汉人,硕士研究生,主要研究方向为大数据。

A Secondary Index Scheme of Big Data in HBase Based on Elasticsearch

LI Chuan-bing

(The Third Research Institute of The Ministry of Public Security,Shanghai 200031,China)

Abstract:HBase has always been used as a NoSQL database in the field of big data.With the increasing amount of data stored in the HBase database,it becomes more and more difficult to query the data in the database.Therefore,a reasonable secondary index scheme is needed to improve the efficiency of the query.Elasticsearch is a high-performance search server,and the efficiency of the query in the HBase database can be improved greatly by storing and searching secondary indexes with Elasticsearch.

Key words:big data;HBase;secondary index;coprocessor;Elasticsearch

1 概述

随着大数据时代的来临,人们所存储的数据量呈爆炸性增长。数据能被用起来做各种数据分析才能发挥数据的价值。而对数据的利用第一步就是查询,查询效率的高低直接影响大数据分析的快慢。因此,很多公司投入相当多的精力去寻找可以提升搜索速度的方案。HBase作为一个可以存储海量数据的数据库,存储性能十分优异,但是查询范围十分有限,在缺少主键的情况下,条件查询效率也比较低下[1],仅仅依靠数据库的搜索功能无法满足商业化的业务需求。于是,有很多新颖的搜索方案被提出,其中比较实用的方案是釆取存储并查询二级索引的方案,加上基于Lucene的分布式搜索引擎Elasticsearch的配合使用[2],整套方案更加可靠、高效。

2 基于Elasticsearch—级索引方案

为了方便测试,构建了一个完整的二级索引存储系统。首先由Kafka的生产者生产批量实验性数据,数据总量1000万条;然后由Kafka的消费者将数据写入HBase,在数据录入的同时,启动HBase的协处理器Coprocessor,通过触发Coprocessor的钩子函数,同步二级索引至Elasticsearch。……

登录APP查看全文

猜你喜欢
数据库机制
构建“不敢腐、不能腐、不想腐”机制的思考
自制力是一种很好的筛选机制
文苑(2018年21期)2018-11-09 01:23:06
数据库
财经(2017年15期)2017-07-03 22:40:49
数据库
财经(2017年2期)2017-03-10 14:35:35
定向培养 还需完善安置机制
中国卫生(2016年9期)2016-11-12 13:28:08
数据库
财经(2016年15期)2016-06-03 07:38:02
数据库
财经(2016年3期)2016-03-07 07:44:46
数据库
财经(2016年6期)2016-02-24 07:41:51
破除旧机制要分步推进
中国卫生(2015年9期)2015-11-10 03:11:12
注重机制的相互配合
中国卫生(2014年3期)2014-11-12 13:18:12