CN106777357A - 一种异步构建HBase全文索引的方法 - Google Patents

一种异步构建HBase全文索引的方法 Download PDF

Info

Publication number
CN106777357A
CN106777357A CN201710038746.5A CN201710038746A CN106777357A CN 106777357 A CN106777357 A CN 106777357A CN 201710038746 A CN201710038746 A CN 201710038746A CN 106777357 A CN106777357 A CN 106777357A
Authority
CN
China
Prior art keywords
hbase
full
index
data
text
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710038746.5A
Other languages
English (en)
Other versions
CN106777357B (zh
Inventor
臧勇真
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Cloud Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710038746.5A priority Critical patent/CN106777357B/zh
Publication of CN106777357A publication Critical patent/CN106777357A/zh
Application granted granted Critical
Publication of CN106777357B publication Critical patent/CN106777357B/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2358Change logging, detection, and notification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Machine Translation (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明提供一种异步构建HBase全文索引的方法,属于计算机软件应用领域,本发明对大数据场景下的HBase数据进行异步实时构建全文索引;通过对HBase的WAL日志的读取和分析,根据用户的配置,对数据构建全文索引。避免了额外的数据处理带来的存储和计算开销。

Description

一种异步构建HBase全文索引的方法
技术领域
本发明涉及计算机软件应用技术,尤其涉及一种异步构建HBase全文索引的方法。
背景技术
随着云计算技术的不断发展,云计算技术不断落地成为支撑各行业信息技术发展的重要支柱。基于Hadoop和HBase的分布式集群,如今已成为国内外云计算热门研究对象。Hadoop的HDFS分布式存储为云平台提供了分布式文件存储***,而HBase因为具有良好的读写性能,并且能够支持大数据量的表,因而适用于简单业务、数据量巨大的在线数据库及数据仓库。由于HBase对事务的支持比较弱,只支持行级事务,因此业务数据库往往由mysql、oracle等成熟的关系型数据库担任,同时HBase能够轻而易举的承载海量数据,这是传统关系数据库不可比拟的,因此HBase往往用来做数据仓库,存储历史明细数据。由于历史数据数据量往往十分巨大,想要根据任意关键字查询数据,需要对每条数据的每个字段全部扫描一遍,犹如大海捞针,常用解决这个问题的手段是对数据在Solr或ElasticSearch中建立全文索引。当前对HBase数据建立全文索引一般有两种方式:一是数据不再写入HBase,而是将数据写入消息队列,然后通过流式计算分发数据,写入HBase和建立全文索引;二是数据在写入HBase之后,通过MapReduce程序读取HBase中的数据,建立全文索引。这两种方式都存在不可避免的缺陷:第一种方式需要将数据存在消息队列中,并且需要编程实现流式计算,增加了存储和计算开销;第二种方式是在写入HBase数据之后,编写MapReduce程序
建立全文索引,这种方式往往是定期执行,每天或每周执行一次,不具时效性,而且建立索引时对HBase的大量访问增加HBase的负担,同时这种方式还面临增量问题,需要对HBase表进行专门的设计。HBase自身实现了replication功能,可以将在数据写入Hbase之后,通过读取WAL日志(Write Ahead Log)异步的将数据写入另一个Hbase集群。基于这个特性,将HBase异步写入另外一个集群改为根据配置将数据建立索引,写入Solr或ElasticSearch中,就实现了实时异步的对数据建立全文索引,并且避免了上述两种方式的弊端。
发明内容
本发明提出了一种异步构建HBase全文索引的方法。解决对HBase数据实时建立全文索引的问题,避免额外存储和计算开销。
通过对HBase的操作日志进行读取并分析,可以异步的对用户所关心的数据根据配置文件建立全文索引。这种方法时效性强,数据进入HBase后立刻就能对数据进行关键字查询,并且不需要额外的存储和计算开销,同时不影响HBase自身性能。
本发明的技术方案是
一种异步构建HBase全文索引的方法,
对大数据场景下的HBase数据进行异步实时构建全文索引;通过对HBase的WAL日志的读取和分析,根据用户的配置,对数据构建全文索引。
在数据写入HBase的同时,读取并分析HBase的操作日志;
通过配置文件对HBase的操作日志进行分析并建立全文索引。
HBase的写数据过程为了保证数据的可靠性,首先将数据写入WAL日志,WAL日志只记录两种操作,写入和删除。这样在HBase发生意外宕机时,能够自动的根据WAL日志中的记录,恢复用户操作。WAL日志会定期滚动
过程如下,
在HBase集群中注册一个peer集群,并在需要建立全文索引的HBase表Table_Index上设置peer集群;
在Zookeeper中对每个RegionServer维护着一个队列,队列中存放需要读取的WAL日志;
HBase在Table_Index表所在的RegionServer上开启单独的线程,根据Zookeeper中WAL日志的队列,读取WAL日志,并解析,分析哪些数据与Table_Index表有关;
在Zookeeper中删除读取完的WAL日志;当有新的WAL日志产生事,添加到Zookeeper队列中;
获取到与Table_Index表有关的WAL日志,就获取到了对Table_Index表的操作记录。根据配置文件,获取需要建立全文索引的字段;
对Table_Index表的操作记录建立全文索引并写入Solr或ElasticSearch中。
本发明的有益效果是
通过对HBaseWAL日志进行读取并解析,然后对HBase数据建立全文索引的方法,具有很好的时效性,并且避免了额外的数据处理带来的存储和计算开销,对需要建立全文索引的HBase表和字段都是可配置的,无需编程,同时由于是异步进行的,对HBase的性能几乎没有影响。
具体实施方式
下面对本发明的内容进行更加详细的阐述:
HBase的写数据过程为了保证数据的可靠性,首先将数据写入WAL日志,WAL日志只记录两种操作,写入和删除。WAL日志会定期滚动。
HBase异步将数据建立全文索引的过程如下:
1、在HBase集群中注册一个peer集群(另一个HBase集群),并在需要建立全文索引的HBase表Table_Index上设置peer集群。
2、在Zookeeper中对每个RegionServer维护着一个队列,队列中存放需要读取的WAL日志。
3、HBase在Table_Index表所在的RegionServer上开启单独的线程,根据Zookeeper中WAL日志的队列,读取WAL日志,并解析,分析哪些数据与Table_Index表有关。
4、在Zookeeper中删除读取完的WAL日志。当有新的WAL日志产生事,添加到Zookeeper队列中。
5、获取到与Table_Index表有关的WAL日志,就获取到了对Table_Index表的操作记录。根据配置文件,获取需要建立全文索引的字段。
6、对Table_Index表的操作记录建立全文索引并写入Solr或ElasticSearch中。

Claims (3)

1.一种异步构建HBase全文索引的方法,其特征在于,
对大数据场景下的HBase数据进行异步实时构建全文索引;通过对HBase的WAL日志的读取和分析,根据用户的配置,对数据构建全文索引。
2.根据权利要求1所述的方法,其特征在于,
在数据写入HBase的同时,读取并分析HBase的操作日志;
通过配置文件对HBase的操作日志进行分析并建立全文索引。
3.根据权利要求2所述的方法,其特征在于,
过程如下,
在HBase集群中注册一个peer集群,并在需要建立全文索引的HBase表Table_Index上设置peer集群;
在Zookeeper中对每个RegionServer维护着一个队列,队列中存放需要读取的WAL日志;
HBase在Table_Index表所在的RegionServer上开启单独的线程,根据Zookeeper中WAL日志的队列,读取WAL日志,并解析,分析哪些数据与Table_Index表有关;
在Zookeeper中删除读取完的WAL日志;当有新的WAL日志产生事,添加到Zookeeper队列中;
获取到与Table_Index表有关的WAL日志,就获取到了对Table_Index表的操作记录;根据配置文件,获取需要建立全文索引的字段;
对Table_Index表的操作记录建立全文索引并写入Solr或ElasticSearch中。
CN201710038746.5A 2017-01-19 2017-01-19 一种异步构建HBase全文索引的方法 Active CN106777357B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710038746.5A CN106777357B (zh) 2017-01-19 2017-01-19 一种异步构建HBase全文索引的方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710038746.5A CN106777357B (zh) 2017-01-19 2017-01-19 一种异步构建HBase全文索引的方法

Publications (2)

Publication Number Publication Date
CN106777357A true CN106777357A (zh) 2017-05-31
CN106777357B CN106777357B (zh) 2020-06-02

Family

ID=58944042

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710038746.5A Active CN106777357B (zh) 2017-01-19 2017-01-19 一种异步构建HBase全文索引的方法

Country Status (1)

Country Link
CN (1) CN106777357B (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107273462A (zh) * 2017-06-02 2017-10-20 郑州云海信息技术有限公司 一种构建HBase集群全文索引方法,数据读取方法以及数据写入方法

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104112013A (zh) * 2014-07-17 2014-10-22 浪潮(北京)电子信息产业有限公司 HBase二级索引方法及装置
CN105069151A (zh) * 2015-08-24 2015-11-18 用友网络科技股份有限公司 HBase二级索引构建装置和方法
US9355109B2 (en) * 2010-06-11 2016-05-31 The Research Foundation For The State University Of New York Multi-tier caching

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9355109B2 (en) * 2010-06-11 2016-05-31 The Research Foundation For The State University Of New York Multi-tier caching
CN104112013A (zh) * 2014-07-17 2014-10-22 浪潮(北京)电子信息产业有限公司 HBase二级索引方法及装置
CN105069151A (zh) * 2015-08-24 2015-11-18 用友网络科技股份有限公司 HBase二级索引构建装置和方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
VINOYANG: "日志***之HBase日志存储设计优化", 《CSND》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107273462A (zh) * 2017-06-02 2017-10-20 郑州云海信息技术有限公司 一种构建HBase集群全文索引方法,数据读取方法以及数据写入方法

Also Published As

Publication number Publication date
CN106777357B (zh) 2020-06-02

Similar Documents

Publication Publication Date Title
US11762882B2 (en) System and method for analysis and management of data distribution in a distributed database environment
CN106897322B (zh) 一种数据库和文件***的访问方法和装置
CN106104526B (zh) 半结构化数据模式的透明发现
WO2015106711A1 (zh) 一种为半结构化数据构建NoSQL数据库索引的方法及装置
CN104036025A (zh) 一种基于分布式的海量日志采集***
CN104111996A (zh) 基于hadoop平台的医保门诊大数据抽取***及方法
CN104407879B (zh) 一种电网时序大数据并行加载方法
CN104850640A (zh) 一种基于HBase的电网设备状态监测数据存储和查询方法及***
Tan et al. Diff-Index: Differentiated Index in Distributed Log-Structured Data Stores.
CN104572505A (zh) 一种保证海量数据缓存最终一致性的***及方法
CN107766541B (zh) 配用电全局全量数据传输及存储方法、装置、电子设备
CN104750720A (zh) 多线程并发访问环境下高性能数据处理的实现
CN103440246A (zh) 用于MapReduce的中间结果数据排序方法及***
CN104317899A (zh) 一种大数据分析与处理***及访问方法
CN107273462A (zh) 一种构建HBase集群全文索引方法,数据读取方法以及数据写入方法
US11822788B2 (en) Data storage management method and apparatus, and computer-readable storage medium
Tan et al. Effectiveness assessment of solid-state drive used in big data services
CN107066205B (zh) 一种数据存储***
CN108304527B (zh) 一种数据提取方法
Sawyer et al. Understanding query performance in Accumulo
CN106777357A (zh) 一种异步构建HBase全文索引的方法
US8918410B2 (en) System and method for fast identification of variable roles during initial data exploration
CN102495710B (zh) 一种处理数据只读访问请求的方法
CN105653680A (zh) 一种基于文档型数据库的存储数据的方法及***
Baranowski et al. Sequential data access with Oracle and Hadoop: a performance comparison

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20200522

Address after: 250100 No. 1036 Tidal Road, Jinan High-tech Zone, Shandong Province, S01 Building, Tidal Science Park

Patentee after: Tidal Cloud Information Technology Co.,Ltd.

Address before: 450000 Henan province Zheng Dong New District of Zhengzhou City Xinyi Road No. 278 16 floor room 1601

Patentee before: ZHENGZHOU YUNHAI INFORMATION TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right
CP01 Change in the name or title of a patent holder

Address after: 250100 No. 1036 Tidal Road, Jinan High-tech Zone, Shandong Province, S01 Building, Tidal Science Park

Patentee after: Inspur cloud Information Technology Co., Ltd

Address before: 250100 No. 1036 Tidal Road, Jinan High-tech Zone, Shandong Province, S01 Building, Tidal Science Park

Patentee before: Tidal Cloud Information Technology Co.,Ltd.

CP01 Change in the name or title of a patent holder