进入Hbase的安装目录,启动Hbase
bin/start-hbase.sh
打开shell命令行模式
bin/hbase shell
关闭Hbase
bin/stop-hbase.sh
一个cell的值,取决于Row,Column family,Column Qualifier和Timestamp
Hbase表结构
1. HBase中创建表,这里面的name,sex,age,dept,course都是column-family
create 'student','name','sex','age','dept','course'
2.Hbase中添加数据,当添加了数据之后,就有了column,‘1000’是ROW
put 'student','1000','name','XiaoMing' #这么写的话,family为name,column为空 put 'student','1000','course:math','99' #这么写的话,family为course,column为math
3.Hbase中查看表
desc 'student' #或者 scan 'student'
4.Hbase中查看某一列
scan 'student',{COLUMN=>'name'}
5.HBase中查看一行
get 'student',1000
6.查看特定行的某几列
get 'student',1000,'name','sex'
7.Hbase中删除某一行的某一列数据
delete 'student','1000','name'
8.Hbase中删除某一行的数据
deleteall 'student','1000'
9.删除某个表
disable ‘student’ drop 'student' #删除之前必须先disable
10.统计记录数
count 'student'
11.清空表
truncate 'student'