1.开启客户端
[root@linux01 /]# hbase shell
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/apps/hadoop-3.2.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/apps/hbase-2.2.5/lib/client-facing-thirdparty/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
HBase Shell
Use "help" to get list of supported commands.
Use "exit" to quit this interactive shell.
For Reference, please visit: http://hbase.apache.org/2.0/book.html#shell
Version 2.2.5, rf76a601273e834267b55c0cda12474590283fd4c, 2020年 05月 21日 星期四 18:34:40 CST
Took 0.0060 seconds
客户端的基本命令
hbase(main):002:0> status --查看当前hbase的状态--
1 active master, 0 backup masters, 3 servers, 0 dead, 0.6667 average load
Took 1.0122 seconds
hbase(main):003:0> version --查看版本--
2.2.5, rf76a601273e834267b55c0cda12474590283fd4c, 2020年 05月 21日 星期四 18:34:40 CST
Took 0.0007 seconds
hbase(main):004:0> whoami --当前用户
root (auth:SIMPLE)
groups: root
Took 0.0429 seconds
2.help查看所有命令
help "commands" 查看命令的使用方法(常用)
注意:单引号双引号通用
hbase(main):013:0> help "list"
List all user tables in hbase. Optional regular expression parameter could
be used to filter the output. Examples:
hbase> list
hbase> list 'abc.*'
hbase> list 'ns:abc.*'
hbase> list 'ns:.*'
3.namespace
hbase中没有数据库的概念,他是使用namespace来实现数据库的作用
4.create创建表(指定列族)
hbase(main):006:0> create "tb_user" , "cf1" --表名tb_user,列族cf1--
Created table tb_user
Took 1.50