码迷,mamicode.com
首页 > 其他好文 > 详细

hbase 基本命令

时间:2016-11-12 23:07:30      阅读:223      评论:0      收藏:0      [点我收藏+]

标签:命令   second   enter   nbsp   return   color   time   查看   cell   

1、用shell来连接HBase

[root@hbase1 bin]# cd /usr/hadoop/hbase-1.1.7/bin

[root@hbase1 bin]# ./hbase shell


HBase Shell; enter help<RETURN> for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 1.1.7, re7ee6fa201c4fb1962f8928df3d519b70b4ff717, Fri Oct  7 18:36:27 PDT 2016

hbase(main):001:0> 

2、创建表

hbase(main):001:0> create table1,col1
0 row(s) in 1.4940 seconds

=> Hbase::Table - table1
hbase(main):002:0> 

3、插入记录

hbase(main):003:0> put table1,row2,col1:b,value2
0 row(s) in 0.0130 seconds

4、查看记录(scan)

hbase(main):002:0>  scan table1
 
row2                 column=col1:b, timestamp=1478957314808, value=value2      
1 row(s) in 30.4430 seconds

5、 用get查看单行数据

hbase(main):011:0> get table1,row1

COLUMN               CELL                                                     

col1:a               timestamp=1317180621803, value=value1                    

1 row(s) in 0.0160 seconds

6、 用disable和drop删除表

hbase(main):017:0> disable table1

0 row(s) in 2.0470 seconds

 

hbase(main):018:0> drop table1

0 row(s) in 0.0960 seconds

 

hbase(main):019:0> list

TABLE                                                                                                                                                   

1 row(s) in 0.0170 seconds

 

hbase 基本命令

标签:命令   second   enter   nbsp   return   color   time   查看   cell   

原文地址:http://www.cnblogs.com/lvlv/p/6057619.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!