1.查看hbase集群状态
status 'simple'
status 'summary'
status 'detailed'
2.查看hbase版本
version
3.创建修改操作
create 'wz:jzx'.'clm'
alter 'wz:mobilemac', {NAME =>'clm',VERSIONS=>3}
4.命名空间
list_namespace
create_namespace jzx
5.显示表描述
desc 'wz:jzx'
describe 'wz:jzx'
6.表合并()
compact 'wz:jzx'
major_compact 'wz:jzx'
7.增删改查
put
get
scan
delete
truncate
8.简单查询
scan 'wz:jzx‘,FILTER => "ValueFilter(=,‘binary:120’)" 搜索值为120的列
scan 'wz:jzx',FILTER => "ValueFilter(=,'substring:120')" 搜索值包含120的列
scan 'wz:jzx',FILTER => "ColumnPrefixFilter('B050016') AND ValueFilter(=,'substring:124')"
scan 'wz:jzx',FILTER => "ColumnPrefixFilter('B050016') AND ValueFilter(=,'substring:124') AND TimestampsFilter(1540000000000,155000000000000)"
scan 'wz:jzx',FILTER => "PrefixFilter('aa')"
scan 'hbase:meta',FILTER =>"PrefixFilter('wz:jzx')"
9.分区合并
merge_region '分区1','分区2',true -----分区1和2我觉得需要相邻,不确定。
10.mob数据测试
hbase org.apache.hadoop.hbase.IntegrationTestIngestWithMOB -threshold 1024 -minMobDataSize 512 -maxMobDataSize 5120
create 't1',{NAME=‘cf’,IS_MOB =>true,MOB_THRESHOLD=>102400,MOB_COMPACT_PARTITION_POLICY=>'daily'}
11.统计表的条数
hbase org.apache.hadoop.hbase.mapreduce.RowCounter 'jzx:t' 使用MapReduce进行统计
count 'wz:jzx' 使用shell的count,这个比较慢。