In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
HBase is a NoSQL database.
What is a NoSQL database?
Saving data based on Key-value
NoSQL databases do not support things
Common NoSQL databases:
HBase: HDFS based, column-oriented database
Table---> Contents
Data---> Documents
Redis: A memory-based NoSQL database that supports persistence (RDB, AOF)
Predecessor: MemCached does not support persistence
MongoDB: Document-based NoSQL database (BSON documents, JSON binary)
Cassandra: Column Oriented NoSQL Database
Table structure of HBase
article(table)
rowkey
content
author
comments
title
text
user
content
Article 1
Chicken or egg first?
……
someone
Hand spray
Chickens don't make you.
Articles...
……
……………………
architecture
HBase Environment Deployment:
Native mode---1 host: no HDFS required, data stored directly on the operating system
1. Install JAVA environment, modify environment variables
2. Install HBase
Pseudo-distribution mode---1 host: HDFS support required, data stored directly on HDFS
1. Install JAVA environment, modify environment variables
2. Deploying HDFS pseudo-distributed
3. Deploying HBase Pseudo-Distributed
Full distribution mode---3 hosts: HDFS support required, data stored directly on HDFS
1. Install JAVA environment, modify environment variables
2. Deploying HDFS Fully Distributed
3. Deploying HBase Fully Distributed
HA Full Distribution Mode---3 hosts
Environmental pre-deployment preparation:
Set environment variable vi ~/.bash_profile
HBASE_HOME=/root/training/hbase-1.3.1
export HBASE_HOME
PATH=$HBASE_HOME/bin:$PATH
export PATH
Local mode:
hbase-env.sh
28 export JAVA_HOME=/root/training/jdk1.8.0_144
hbase-site.xml
hbase.rootdir
file:///root/training/hbase-1.3.1/data
Start HBase: start-hbase.sh
pseudo-distributed mode
hbase-env.sh
129 export HBASE_MANAGES_ZK=true
hbase-site.xml
hbase.rootdir
hdfs://192.168.157.11:9000/hbase
hbase.cluster.distributed
true
hbase.zookeeper.quorum
192.168.157.11
dfs.replication
1
regionservers
192.168.157.11
Start HBase: start-hbase.sh
fully distributed model
hbase-site.xml
hbase.rootdir
hdfs://192.168.157.12:9000/hbase
hbase.cluster.distributed
true
hbase.zookeeper.quorum
192.168.157.12
dfs.replication
2
hbase.master.maxclockskew
180000
regionservers
192.168.157.13
192.168.157.14
scp -r hbase-1.3.1/ root@bigdata13:/root/training
scp -r hbase-1.3.1/ root@bigdata14:/root/training
Start HBase: start-hbase.sh
HA of HBase
No additional configuration required, only a single point on one of the slave nodes to start Hmaster
Start HBase: start-hbase.sh
bigdata13:hbase-daemon.sh start master
HBase Web Console web port: 16010
HBase command line operations:
Go to Command Line: hbase shell
View:
View table: list
Query data:
scan is equivalent to select * from table name
Get is equivalent to select * from table name where rowkey=?
Insert data:
put 'table',' row','column family': column name',' value '
put 'students', 'stu1', 'info:name', 'Tom'
Clear the table of data:
truncate 'table name'--------> The essence of truncate is to delete the table before creating it
truncate 'students'
Delete table:
disable 'table name'
drop 'table name'
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.