HBase

1) HABSE 简介
 2)HBase 特点
 3)HBase 数据模型
4)HBase体系结构
5)HBase存储模型
6)HBase应用
 
简介
1)Hbase是一个分布式的。多版本的。面向列的开源数据库
2)HBase利用HadoopHDFS作为文件存储系统,提供高可靠性。高性能。列存储。可伸缩。实时读写。适用于结构化数据存储的数据库系统。
3)HBase利用Hadoop MapReduce来处理HBase中的海量数据
4)HBase利用Zookeeper作为分布式协同服务
 
HBase操作
1)flush
内存容量有限,需要定期将内存中的数据flush到磁盘每次flush,每个region的每个column famlly都会昌盛一个HFile读取操作,region server会把多个HFile数据归并到一起
 
HBase应用
1)HBase环境搭建
配置hbase-env.sh , hbase-site.xml , regionservers运行start-hbase.sh
启动hbase shell进行交互命令行
2)HBase API使用距离Put/get Scan
命令:create 'test','info'列组
scan ‘test’ 
put 'test','row1','info:A','1'
put 'test','row1','infoB,'1'
put 'test','row1','infoB;,'1'
scan 'test'
put 'test','row1','info:B','2'
disable 'test'
drop 'test'
Shell操作
create 'scores','grade','course'
describe 'scores'
put 'scores','Tom','grade','5'
put 'scores','Tom',
put 'scores', 'Tom','course:math','97'
put 'scores','Tom','course:art','87'
put 'scores', 'Jim','course:Eglish','97'
put 'scores','Jim','course:China','87'
get 'scores','Tom'
//获取所有的版本
get 'scores','Tom',{column=>'course:math',VERSION=>3}
alter 'scores',{NAME=>'course',VERSIONS=>3}
discrible scores
put 'scores','Tom','course:math','80'
get 'scores','Tom','course:math' 
get 'scores','Tom',{column=>'course:math',VERSION=>3}
count 'scores' //统计
disable 't1'
drop 't1'
 
scan 'students'
scan  'students',{STARTROW=>'J', ENDROW=>'K'}
 
协处理器:
disable 'students';
alter 'students','coprocessor'=>hdfs://nsl/coprocessor.jar|com.hbase.RegionObserverTest||'
 
posted @ 2016-09-29 11:32  love郎朗you  阅读(150)  评论(0编辑  收藏  举报