美文网首页
HBase的shell操作

HBase的shell操作

作者: 羋学僧 | 来源:发表于2020-08-19 18:19 被阅读0次

HBase的Shell命令行操作

1、进入HBase客户端命令行

cd /home/bigdata/apps/hbase-1.3.1/
bin/hbase shell

或者

hbase shell

2、帮助命令

 help

3、创建表

create 'student','info'

4、查看当前数据库中有哪些表

 list

5、插入数据到表

put 'student','1001','info:sex','male' 
put 'student','1001','info:age','18' 
put 'student','1002','info:name','zhangsan' 
put 'student','1002','info:sex','female' 
put 'student','1002','info:age','20'

6、查看表数据

scan 'student'

指定查询
//前闭后开 
scan 'student',{STARTROW => '1001', STOPROW  => '1002'}

7、查看表结构

describe 'student'
des 'student'

8、修改数据

put 'student','1002','info:name','lisi'

9、获取数据

get 'student','1001'
get 'student','1002','info:name'

统计数据量
count 'student'

10、 清空表数据

truncate 'student'

11、删除表 先disable,再drop。

disable 'student'
drop 'student'

相关文章

网友评论

      本文标题:HBase的shell操作

      本文链接:https://www.haomeiwen.com/subject/dcedjktx.html