HBase学习笔记(2)—— 常用shell 命令

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u012292754/article/details/82709445

1 hbase shell 命令

1.1 启动和退出

start-hbase.sh
hbase shell
quit
这里写图片描述

1.2 创建表

create '表名', '列族名1','列族名2','列族名N'

这里写图片描述
这里写图片描述

1.3 查看表是否存在

exists  '表名'

这里写图片描述

1.4 判断是否禁用启用表

is_enabled '表名'
is_disabled ‘表名’

1.5 添加记录

put  ‘表名’, ‘rowKey’, ‘列族 : 列‘  ,  '值'

这里写图片描述
这里写图片描述

1.6 查看记录rowkey下的所有数据

get  '表名' , 'rowKey'

这里写图片描述

1.7 查看表中的记录总数

count  '表名'

这里写图片描述
这里写图片描述

1.8 获取某个列族

get '表名','rowkey','列族'

这里写图片描述

1.9 获取某个列族的某个列

get '表名','rowkey','列族:列’

1.10 删除记录

delete  ‘表名’ ,‘rowkey’ , ‘列族:列'

1.11 删除整行

deleteall '表名','rowkey'

1.12 删除表

先要屏蔽该表,才能对该表进行删除
第一步 disable ‘表名’ ,第二步  drop '表名'

1.13 清空表

truncate '表名'

1.14 查看某个表某个列中所有数据

scan "表名" , {COLUMNS=>'列族名:列名'}

1.15 更新记录

就是重写一遍,进行覆盖,hbase没有修改,都是追加

猜你喜欢

转载自blog.csdn.net/u012292754/article/details/82709445