The invention relates to the field of Hbase real-time indexing technology, in particular to a large data real-time indexing method based on Hbase coprocessor, including adding coprocessor monitoring to tables requiring indexing, defining KEY of corresponding actions for DDL and DML actions in Hbase, writing action monitoring code based on Hbase coprocessor, and sending data serialization of operations in Hbase to kafka. \u3002 The invention monitors the DML and DDL actions of Hbase, senses the tables and data operation actions of HBase in time, encapsulates the corresponding actions, and sends them to the message queue of kafka. At the same time, the index converter can index the data and corresponding actions in kafka, decouples the action monitoring of HBase and the data index writing program, and avoids the data. The inconsistency of read and write speeds results in the problem of resource waiting to occupy resources.
【技术实现步骤摘要】
一种基于Hbase协处理器的大数据实时索引方法
本专利技术涉及Hbase实时索引
,具体涉及一种基于Hbase协处理器的大数据实时索引方法。
技术介绍
HBase是一种构建在HDFS之上的分布式、面向列的存储系统。在需要实时读写、随机访问超大规模数据集时,可以使用HBase。但是由于hbase的数据读取,全部依赖于hbase的rowkey。为了实现能够基于对hbase中的部分数据进行复杂查询、或者进行全文检索,需要对hbase进行构建索引。传统的索引方法对于hbase索引的时候是循环读取Hbase表数据,然后直接将hbase表数据,存储到elasticsearch或者solr等索引服务器中。或者通过Hbase和elasticsearch进行直连,实现数据的直接进入索引集群,这样会对于hbase读取和elasticsearch写入的读写速度不同步造成阻塞的压力。
技术实现思路
本专利技术的目的在于克服现有技术中存在的问题,提供一种基于Hbase协处理器的大数据实时索引方法,它可以实现能够基于hbase中数据操作,实时对hbase数据进行提交到elasticsearch索引的方法,同时解决由于elasticsearch等索引服务器写入速度和hbase读取速度不一致造成的对索引集群或者hbase集群的资源占用压力,更好的解除hbase集群与索引服务集群之间的耦合。为实现上述技术目的,达到上述技术效果,本专利技术是通过以下技术方案实现的:一种基于Hbase协处理器的大数据实时索引方法,包括如下步骤:Step1,对于需要索引的表,添加协处理器监听;Step2,针对 ...
【技术保护点】
1.一种基于Hbase协处理器的大数据实时索引方法,其特征在于,包括如下步骤:Step1,对于需要索引的表,添加协处理器监听;Step2,针对Hbase中DDL、DML动作,定义相应动作的KEY;Step3,编写基于Hbase协处理器的动作监听代码,以及将Hbase中操作的数据序列化发送到kafka;Step4,将Hbase协处理动作数据进行处理,转成字节流写入Kafka中;Step5,编写Kafka消费程序,对kafka中的数据进行转换,转成elasticsearch中Doc对象;Step6,将数据实时写入elasticsearch中;Step7,数据查询。
【技术特征摘要】
1.一种基于Hbase协处理器的大数据实时索引方法,其特征在于,包括如下步骤:Step1,对于需要索引的表,添加协处理器监听;Step2,针对Hbase中DDL、DML动作,定义相应动作的KEY;Step3,编写基于Hbase协处理器的动作监听代码,以及将Hbase中操作的数据序列化发送到kafka;Step4,将Hbase协处理动作数据进行处理,转成字...
【专利技术属性】
技术研发人员:朱静轩,吴问海,章文友,孟彦,
申请(专利权)人:中新网络信息安全股份有限公司,
类型:发明
国别省市:安徽,34
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。