读书人

HBase shell 容易使用

发布时间: 2013-08-29 10:33:02 作者: rapoo

HBase shell 简单使用

增加记录
>put 'blog','1','article:title,' Head First HBase '
>put 'blog','1','article:content','HBase is the Hadoop database. Use it when you need random, realtime read/write access to your Big Data.'
> put 'blog','1','article:tags','Hadoop,HBase,NoSQL'
> put 'blog','1','author:name','hujinjun'
> put 'blog','1','author:nickname',’一叶渡江’
知识点回顾:Column完全动态扩展,每行可以有不同的Columns。

根据RowKey查询
> get 'blog','1'

HBase shell 容易使用

知识点回顾:HTable按RowKey字典序(1,10,100,11,2)自动排序,每行包含任意数量
的Columns,Columns按ColumnKey(article:content,article:tags,article:title,author:name,author:nickname)自动排序

查询列族

>get 'blog','1','author

HBase shell 容易使用

查看表内容

>scan 'blog'

HBase shell 容易使用

更新练习

读书人网 >软件架构设计

热点推荐