Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Hbase principle

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Hbase process system diagram

Hbase write data flow 1. Client sends a write request to hregionserver. 2. Hregionserver writes the data to hlog (write ahead log). For data persistence and recovery. 3. Hregionserver writes the data to memory (memstore) 4 and feedback the success of client. Data flush process 1. When the memstore data reaches the threshold (the default is 64m), the data is brushed to the hard disk, the data in memory is deleted, and the historical data in hlog is deleted. 2. And store the data in hdfs. 3. Mark points in hlog. Data merging process 1, when the data reaches 4 blocks, hmaster loads the data blocks locally, merges 2, when the merged data exceeds 256m, splits the split region to different hregionserver management 3, when the hregionser is down, it is split with the hlog on the regionserver, and then assigned to different hregionserver to load and modify .meta. 4. Note: hlog will synchronize to hdfsHbase to read data flow 1, through zookeeper and-ROOT-.META. Table locates hregionserver. 2. Data will be returned to client3 after merging from memory and hard disk, and data blocks will cache the responsibility of hmaster. 1. Manage users' operations such as adding, deleting, changing and querying table. 2. Record which HRegion Server the region is on. 3. After the Region Split, it is responsible for the allocation of the new Region. 4. Manage the load balance of the HRegion Server and adjust the Region distribution when the new machine joins. 5. Be responsible for the Region migration on the failed HRegion Server after the HRegion Server downtime. Responsibility of hmaster 1. HRegion Server is mainly responsible for reading and writing data to the HDFS file system in response to the user's request, which is the core module of HBASE. 2. HRegion Server manages a lot of table partitions, that is, region. Client responsibility 1, HBASE Client uses HBASE's RPC mechanism to communicate with HMaster and RegionServer 2, management operations: Client and HMaster for RPC;3, data read and write operations: Client and HRegionServer for RPC. Hbase depends on zookeeper

1. Save the address and backup-master address of Hmaster

Hmaster:

A) manage HregionServerb) add, delete and change the node of the table c) manage the table allocation in HregionServer

2. Save the table-the address of ROOT-

Hbase default root table, key table.

3. HRegionServer list

Add, delete, change and check data of the table.

Interact with hdfs and access data.

Hbase command name command expression to create table create 'table name', 'column family name' column family name N' view all tables list description table describe 'table name' determine whether to disable table is_enabled 'table name' Is_disabled 'table name' add record put 'table name', 'rowKey',' column family: column', 'value' view all data under record rowkey 'table name', 'rowKey' view total number of records in table' table name', 'get a column family get' table name', 'rowkey',' column family' get a column get 'table name', 'rowkey',' column family: column' delete record delete 'table name' 'Row name', 'column family': column 'delete entire row deleteall' table name', 'rowkey' delete a table before it is masked Before the table can be deleted. The first step is disable 'table name', the second step is drop 'table name' clear table truncate 'table name' view all records scan "table name" view all data in a table column scan "table name", {COLUMNS= > 'column family name: column name'} to update the record is to rewrite and overwrite, hbase is not modified, it is appended

At this point, the basic principles of hbase and the use of commands have been written.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report