hbase学习一 shell命令操作

基本操作:
#命名空间级别:
#列出所有命名空间
hbase> list_namespace
#新建命名空间
hbase> create_namespace 'ns1'
#删除命名空间
hbase> drop_namespace 'ns1'
#修改命名空间
#表级别:
#列出所有表
hbase> list
#列出指定命名空间下的所有表
hbase> list_namespace_tables 'ns1'
#新建一个以命名空间ns1的表t1,列族为cf1。
hbase> create 'ns1:t1', 'cf1'
#删除表
hbase> disable 'ns1:t1'
hbase> drop 'ns1:t1'
#修改表名
HBase没有rename命令,可以通过快照功能修改表名,详见下述。
#查看表内容
hbase> scan 'ns1:t1', {LIMIT=>} # 查看前5行数据
#插入
hbase> put 'ns1:t1', 'r1', 'cf1:c1', 'value'
#查看
hbase> get 'ns1:t1', 'r1' #表分区(region分裂多个region以及region合并)
#建表预分区
create 'gld:student', 'cf1', {SPLITS => ['', '', '', '', '', '', '', '', '']}
每个分区的Start Key和End Key分别为:(~, ),[, ),[, ),[, ),[, ),[, ),[, ),[, ),[, ),[, ~)
#手动分区
#合并分区
上一篇:临时节点不能有child 子节点


下一篇:JSP中request对象常用方法汇总