https://blog.csdn.net/yitengtongweishi/article/details/81983379
blockchain@Dao:~$ hbase-1.4.6/bin/hbase shell
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/blockchain/hbase-1.4.6/lib/phoenix-4.14.0-HBase-1.4-client.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/blockchain/hbase-1.4.6/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
HBase Shell
Use "help" to get list of supported commands.
Use "exit" to quit this interactive shell.
Version 1.4.6, ra55bcbd4fc87ff9cd3caaae25277e0cfdbb344a5, Tue Jul 24 16:25:52 PDT 2018
hbase(main):001:0>
hbase(main):001:0> whoami
blockchain (auth:SIMPLE)
groups: blockchain, adm, cdrom, sudo, dip, plugdev, lpadmin, sambashare
hbase(main):002:0>
hbase(main):018:0* status
1 active master, 0 backup masters, 1 servers, 0 dead, 2.0000 average load
hbase(main):019:0>
hbase(main):025:0* version
1.4.6, ra55bcbd4fc87ff9cd3caaae25277e0cfdbb344a5, Tue Jul 24 16:25:52 PDT 2018
hbase(main):026:0>
hbase(main):027:0* create 'tab1', 'cf1'
0 row(s) in 2.6090 seconds
=> Hbase::Table - tab1
hbase(main):028:0> create 'tab2', 'cf1', 'cf2'
0 row(s) in 2.3570 seconds
=> Hbase::Table - tab2
hbase(main):029:0>
hbase(main):031:0* list
TABLE
tab1
tab2
2 row(s) in 0.0050 seconds
=> ["tab1", "tab2"]
hbase(main):032:0>
hbase(main):033:0* put 'tab1', 'row-1', 'cf1:greet', 'Hello'
0 row(s) in 0.0620 seconds
hbase(main):034:0> put 'tab1', 'row-1', 'cf1:pie', 3.14
0 row(s) in 0.0460 seconds
hbase(main):035:0> put 'tab1', 'row-2', 'cf1:pie', 3.14
0 row(s) in 0.0060 seconds
hbase(main):039:0* get 'tab1', 'row-1'
COLUMN CELL
cf1:greet timestamp=1535459800225, value=Hello
cf1:pie timestamp=1535459813854, value=3.14
1 row(s) in 0.0300 seconds
hbase(main):040:0>
hbase(main):041:0* get 'tab1', 'row-2'
COLUMN CELL
cf1:pie timestamp=1535459822153, value=3.14
1 row(s) in 0.0030 seconds
hbase(main):042:0>
hbase(main):017:0>
hbase(main):018:0* count 'tab1'
2 row(s) in 0.0030 seconds
=> 2
hbase(main):019:0>
hbase(main):044:0* scan 'tab1'
ROW COLUMN+CELL
row-1 column=cf1:greet, timestamp=1535459800225, value=Hello
row-1 column=cf1:pie, timestamp=1535459813854, value=3.14
row-2 column=cf1:pie, timestamp=1535459822153, value=3.14
2 row(s) in 0.0120 seconds
hbase(main):045:0>
hbase(main):046:0* describe 'tab1'
Table tab1 is ENABLED
tab1
COLUMN FAMILIES DESCRIPTION
{NAME => 'cf1', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FA
LSE', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', COMPRESSION => 'NONE', MIN_VERSIONS => '0', BLO
CKCACHE => 'true', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'}
1 row(s) in 0.0270 seconds
hbase(main):047:0>
hbase(main):048:0* delete 'tab1', 'row-1', 'cf1:pie'
0 row(s) in 0.0210 seconds
hbase(main):049:0> scan 'tab1'
ROW COLUMN+CELL
row-1 column=cf1:greet, timestamp=1535459800225, value=Hello
row-2 column=cf1:pie, timestamp=1535459822153, value=3.14
2 row(s) in 0.0090 seconds
hbase(main):050:0>
hbase(main):053:0> disable 'tab1'
0 row(s) in 2.3870 seconds
hbase(main):054:0> drop 'tab1'
0 row(s) in 1.3190 seconds
hbase(main):055:0> list
TABLE
tab2
1 row(s) in 0.0040 seconds
=> ["tab2"]
hbase(main):056:0>
hbase(main):058:0* exists 'tab1'
Table tab1 does not exist
0 row(s) in 0.0100 seconds
hbase(main):059:0> exists 'tab2'
Table tab2 does exist
0 row(s) in 0.0030 seconds
hbase(main):060:0>
hbase(main):062:0* exit
blockchain@Dao:~$
blockchain@Dao:~$
友情链接