[Hbase]hbase命令行基本操作

-进入hbase shell

hbase shell

- 帮助help

help

- 查看hbase version
version

- 查看hbase 状态

status


- 创建表
create 'tableName', 'columnFamily:column'

- 查看存在哪些表

list

- 查看表结构
describe 'tableName'

- 存储数据
put 'tableName','rowkey','columnFamily:column','value'

- 获取数据

- get 'tableName','rowkey','columnFamily:column'

- 扫描整个表数据
scan 'tableName'

- 扫描整个列簇

scan 'tableName', {COLUMN=>'info'}

- 删除指定数据
delete 'tableName','rowkey',{'columnFamily:column'}

- 改变或添加一个列族
alter 'tableName',NAME=>'columnFamily',version=>版本号

- 查看表中的记录总数
count 'tableName'

-使用exists来检查表是否存在
exists 'tableName'

猜你喜欢

转载自www.cnblogs.com/amberly/p/10249047.html