In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
1. What is the concept of HBase 1.1 HBase HBase is based on Google's BigTable paper, is built on the = = HDFS==, provides high reliability, high performance, column storage, scalable, real-time read-write distributed database system. You can use HBase when you need to read and write random access in real time. 1.2 the characteristics of HBase = = mass storage = = can store large quantities of data = = column storage = = the data of the HBase table is stored based on the column family, which is divided in the column direction. The underlying layer depends on HDFS. When disk space is insufficient, you only need to add datanode nodes dynamically to expand the storage capacity of the cluster. You can add servers to expand the storage capacity of the cluster = = support highly concurrent read and write requests = = sparse = = sparse is mainly for the flexibility of HBase columns. In the column family, you can specify as many columns as you want. If the column data is empty, it will not take up storage space. = = multiple versions of data = = data in the HBase table can have multiple version values. By default, the version number is distinguished by the version number, which is the timestamp of the data inserted = = single data type = = all data is stored in HBase as = = byte array = = stored in Hbase all day.
2.1 Client client Client is the entry for operating HBase cluster operations on management classes, such as table add, delete, change manipulation, Client communicates with HMaster through RPC to complete read and write operations on table data, Client interacts with RegionServer through RPC, read and write data Client types: HBase shellJava programming interface Thrift, Avro, Rest, etc. 2.2 ZooKeeper cluster
Action
High availability of HMaster is realized, and active and standby elections are carried out among multiple HMaster.
The metadata information meta table of HBase is saved, and the clue data of the address entry of region in HBase table is provided.
The HMasterHBase cluster is also the master and slave architecture for HMaster and HRegionServer. HMaster is the master role, and the boss is mainly responsible for the related management of Table table and Region: about the operation of Table management Client's addition, deletion and modification of Table. After the split of Region, Region is responsible for assigning the new Region to the designated HRegionServer to manage the load balance between HRegionServer, migrating region distribution when HRegionServer downtime, responsible for the migration of region on it 2.4 HRegionServerHBase cluster slave role
Action
In response to the read and write data request from the client, it is responsible for managing a series of Region shredding the smallest unit of distributed storage in a region2.5 RegionHBase cluster that becomes larger during operation. Part of the data of a Region corresponding to a Table table 3. HBase data model
3.1 rowkey row key primary key of table, the records in table are sorted according to the dictionary order of rowkey. The row key can be any string (the maximum length is 64KB, the length in practical application is generally 10-100bytes). 3. Each column in the Column Family column family column family or column cluster HBase table belongs to a column family that is part of the schema of the table (but the column is not), that is, at least one column family is specified when the table is created, such as creating a table named user. There are two column families, info and data. The table statement create 'user',' info', 'data'3.3 Column column must be a column under a certain column family of the table, represented by the column family name, such as the name column under the info column family, indicating that info:name belongs to a certain ColumnFamily, similar to the specific column 3.4 cell cell created in our mysql that specifies row key row keys, column families, and columns. It can be determined that the data in a cell is untyped and is all stored in a byte array.
The Timestamp timestamp can be assigned to the Cell in the table many times. The timestamp timestamp of each assignment operation can be regarded as the version number version number of the Cell value, that is, a Cell can have multiple versions of the value 4, HBase installation and deployment 4.1, download the installation package
Download address: https://archive.apache.org/dist/hbase/1.2.1/
4.2. Install Hbase
Extract to the installation directory: tar-zxcf habse-1.2.1-bin.tar.gz-C / opt/bigdata2.7
Rename the decompression directory: mv hbase-1.2.1 hbase
4.3. Modify the configuration file
1. You need to copy the configuration file core-site.xml,hdfs-site.xml in hadoop to the conf folder under the hbase installation directory
2. Modify the configuration file under the conf directory
(1) modify hbase-env.sh
# add java environment variable export JAVA_HOME=/kkb/install/jdk1.8.0_141export HBASE_MANAGES_ZK= false`
(2) modify hbase-site.xml
Hbase.rootdir hdfs://node01:8020/hbase hbase.cluster.distributed true hbase.zookeeper.quorum node01:2181,node02:2181,node03:2181
(3) modify regionservers
Vim regionservers
Node02
Node03
(4) modify backup-masters'
Node2
3. Configure the environment variables of hbase
Vi / etc/profile
Export HBASE_HOME=/opt/bigdata2.7/hbase
Export PATH=$PATH:$HBASE_HOME/bin
4.4. distribute hbase directories to other nodes
Enter the habase directory: cd / opt/bigdata2.7
Scp-r hbase node2:/opt/bigdata2.7
Scp-r hbase node3:/opt/bigdata2.7
Scp / etc/profile node2:/etc
Scp / etc/profile mpde3:/etc
4.5. let all node hbase environment variables take effect
Execute on all nodes:
Source / etc/profile
5. Start and stop the Hbase cluster
(1) start
Prerequisite: start hadoop cluster and zookeeper cluster first
Start hbase
Start-hbase.sh
(2) stop
Stop-hbase.sh
Profile mpde3:/ etc`
4.5. let all node hbase environment variables take effect
Execute on all nodes:
Source / etc/profile
5. Start and stop the Hbase cluster
(1) start
Prerequisite: start hadoop cluster and zookeeper cluster first
Start hbase
Start-hbase.sh
(2) stop
Stop-hbase.sh
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.