HBase 基本命令:
1、进入 HBase 客户端:
hbase shell
如果出现 jdk 的警告,则对 conf 下的 hbase-env.sh 文件中的 第 45-47 行进行注释:
2、查看帮助命令
hbase(main)> help
3、查看当前数据库中有那些表
hbase(main)> list
4、查看当前数据库中有哪些命名空间
hbase(main)> list_namespace
5、查看命令的使用方法 如:list
hbase(main)> help ‘list’
hbase> list
hbase> list 'abc.*'
hbase> list 'ns:abc.*'
hbase> list 'ns:.*'
HBase 表的操作:
1、创建表
# 表名 列簇
create 'student','cf1'
2、插入数据
(只能一条一条的插入)
put 'student','1001','cf1:name','zhangsan'
put 'student','1001','cf1:sex','male'
put 'student','1001','cf1:age','18'
put 'student','1002','cf1:name','Janna'
put 'student','1002','cf1:sex','female'
put 'student','1002','cf1:age','20'
插入数据后的数据模型
3、查看表数据
scan 'student'