目录
Standalone
java -version
# java version "11.0.8" 2020-07-14 LTS
wget https://mirror.bit.edu.cn/apache/hbase/2.2.6/hbase-2.2.6-bin.tar.gz
tar xf hbase-2.2.6-bin.tar.gz && cd hbase-2.2.6
./bin/start-hbase.sh
# running master, logging to /path/to/hbase-2.2.6/bin/../logs/
jps
# 50847 HMaster
# 51359 Jps
-
In standalone mode HBase runs all daemons within this single JVM, i.e. the HMaster, a single HRegionServer, and the ZooKeeper daemon.
HBase Shell
./bin/hbase shell
# help
# 创建表 并设置表名和列簇名
create 'test', 'cf'
list
describe 'test'
put 'test', 'row1', 'cf:a', 'value1'
put 'test', 'row2', 'cf:b', 'value2'
put 'test', 'row3', 'cf:c', 'value3'
scan 'test'
# ROW COLUMN+CELL
# row1 column=cf:a, timestamp=1606804404848, value=value1
# row2 column=cf:b, timestamp=1606804408814, value=value2
# row3 column=cf:c, timestamp=1606804413633, value=value3
# 3 row(s)
get 'test', 'row1'
# COLUMN CELL
# cf:a timestamp=1606804404848, value=value1
# 1 row(s)
put 'test', 'row1', 'cf:a', 'value11'
get 'test', 'row1'
# COLUMN CELL
# cf:a timestamp=1606804508879, value=value11
# 1 row(s)
get 'test', 'row1', {TIMESTAMP => 1606804404848}
# COLUMN CELL
# cf:a timestamp=1606804404848, value=value1
# 1 row(s)
网友评论