hbase shell,
HBaseshell
1、 启动hbase shell
(1) 确保hadoop 、zookeeper启动
(2) 确保hbase启动
(3) 执行hbase shell命令(在已经配置环境变量的情况下)
2、 查看表
(1)list
hbase(main):001:0> list 'test'
TABLE
test
1 row(s) in 0.3460 seconds
=> ["test"]
(2)exists
hbase(main):002:0> exists 'test'
Table test does exist
0 row(s) in 0.1110 seconds
3、 新建表
create 'test',{NAME => 'f1',VERSIONS => 4}4、 修改表(alter)
alter 'test',NAME => 'f1',VERSIONS =>3
5、删除表(删除之前要先disable)
disable 'test'
drop 'test'
6、描述表
describe 'test'(desc 'test')
7、插入数据
put 'test','row1','f1:name','zhangsan'
8、表数据获取(scan/get)
scan 'test'
get 'test',{COLUMN=>'f1:name',VERSIONS => 3}
9、表数据删除(deleteall删除整行)
deleteall't1','row1'