信息网络安全 ›› 2017, Vol. 17 ›› Issue (8): 39-44.doi: 10.3969/j.issn.1671-1122.2017.08.006

• • 上一篇    下一篇

一种基于Solr的HBase海量数据二级索引方案

王文贤1,2, 陈兴蜀1,2, 王海舟1,2(), 吴小松2   

  1. 1. 四川大学网络空间安全研究院,四川成都610065
    2. 四川大学计算机学院网络与可信计算研究所,四川成都610065
  • 收稿日期:2017-06-26 出版日期:2017-08-20 发布日期:2020-05-12
  • 作者简介:

    作者简介: 王文贤(1978—),男,福建,讲师,博士,主要研究方向为网络空间安全、舆情分析和挖掘;陈兴蜀(1968—),女,贵州,教授,博士,主要研究方向为云计算和大数据安全、网络情报分析;王海舟(1986—),男,四川,讲师,博士,主要研究方向为网络空间安全、舆情分析和挖掘;吴小松(1989—),男,四川,硕士研究生,主要研究方向为网络空间安全、文本挖掘。

  • 基金资助:
    国家科技支撑计划[2012BAH18B05];国家自然科学基金 [61272447];四川省科技厅计划项目[16ZHSF0483]

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

Wenxian WANG1,2, Xingshu CHEN1,2, Haizhou WANG1,2(), Xiaosong WU2   

  1. 1.Cybersecurity Research Institute, Sichuan University, Chengdu Sichuan 610065, China
    2.Network and Trusted Computing Institute, College of Computer, Sichuan University, Chengdu Sichuan 610065, China
  • Received:2017-06-26 Online:2017-08-20 Published:2020-05-12

摘要:

针对HBase不提供二级索引和华为的hindex方案难以满足海量数据检索速度需求的问题,文章设计了基于Solr的HBase二级索引方案SIHBase(Solr Indexing HBase)。该方案使用HBase的Coprocessor(协处理器)为数据表的创建、修改、删除以及数据的插入、更新、删除和恢复等操作都实现了相应的回调函数,通过回调函数向Solr发送相关请求,以实现在Solr中自动为HBase建立和维护二级索引,保证数据与索引的一致性。该方案具有良好的通用性,可以同时为多张表的多列数据建立索引。该方案扩展了HBase的客户端功能,增加了直接查询Solr的接口,利用Solr提供的高效、灵活、多样的检索功能实现对HBase海量数据的快速检索。最后,与hindex进行了二级索引的查询性能对比实验,证明了该方案在查询速度上要远快于hindex。

关键词: HBase, 二级索引, Solr, 快速检索

Abstract:

For the problem that HBase cannot provide secondary indexes and Huawei hindex scheme is difficult to meet the project demand of retrieval speed, designed an HBase secondary index scheme named SIHBase (Solr Indexing HBase) based on Solr. The scheme uses HBase Coprocessor to achieve the related callback function for creating, changing, deleting operations of the data tables and inserting, updating, deleting recovering operations of data. Thus, it can create and manage secondary indexes in Solr for HBase automatically and ensure the consistency of the data and index. The scheme has favorable generality and can create index for multi-column data of multiple tables in the meantime. And then extended the client-side function of HBase, increased the direct query interface of Solr, using efficient, flexible and diversified retrieval functions which Solr provided to realize quick retrieval for the mass data of HBase. Finally, a contrast experiment about query performance with hindex show that SIHBase was turned out to be much faster than hindex in query speed.

Key words: HBase, secondary index, Solr, quick retrieval

中图分类号: