1.建表
create 'hbase1','hb1'
2.查看库中有哪些表
list
3.用describe命令来查看表属性
describe 'hbase1'
4.增加一个列族
alter 'hbase1','hb2'
5.插入数据
put 'hbase1','row','hb1:name','zhangsan'
//一次只能put一个column
6.用 scan查看表数据
scan ‘hbase1’
scan 'hbase1',{STARTROW=>'row2'}
scan 'hbase1',{STARTROW=>'row1',ENDROW=>'row3'}
7.用 get 来获取单元格数据
get 'hbase1','row1',{COLUMN=>'hb1:name'}
//返回多版本
alter 'hbase1',{NAME=>'cf',VERSIONS=>3}
get 'hbase1','row1',{COLUMN=>'cf:name',VERSIONS=>3}
scan ‘hbase1’ ,{VERSIONS=>3}
8.删除数据
delete 'hbase1','row1','cf:name' ,{版本号}
scan ‘hbase1’,{RAW=>true,VERSIONS=>3} //可查询打上墓碑标记的记录
deleteall 'hbase1','row1'
9.删除表
drop ‘test’