10) 测试:在HBase上创建表
[Hadoop@node01 logs]$ hbase shell
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 0.90.5, r1212209, Fri Dec 9 05:40:36 UTC 2011
hbase(main):001:0> status
3 servers, 0 dead, 0.6667 average load
hbase(main):002:0> create 'testtable', 'colfam1'
0 row(s) in 1.4820 seconds
hbase(main):003:0> list 'testtable'
TABLE
testtable
1 row(s) in 0.0290 seconds
hbase(main):004:0> put 'testtable', 'myrow-1', 'colfam1:q1', 'value-1'
0 row(s) in 0.1980 seconds
hbase(main):005:0> put 'testtable', 'myrow-2', 'colfam1:q2', 'value-2'
0 row(s) in 0.0140 seconds
hbase(main):006:0> put 'testtable', 'myrow-2', 'colfam1:q3', 'value-3'
0 row(s) in 0.0070 seconds
hbase(main):007:0> scan 'testtable'
ROW COLUMN+CELL
myrow-1 column=colfam1:q1, timestamp=1365829054040, value=value-1
myrow-2 column=colfam1:q2, timestamp=1365829061470, value=value-2
myrow-2 column=colfam1:q3, timestamp=1365829066386, value=value-3
2 row(s) in 0.0690 seconds
hbase(main):008:0> get 'testtable', 'myrow-1'
COLUMN CELL
colfam1:q1 timestamp=1365829054040, value=value-1
1 row(s) in 0.0330 seconds
hbase(main):009:0> delete 'testtable', 'myrow-2', 'colfam1:q2'
0 row(s) in 0.0220 seconds
hbase(main):010:0> scan 'testtable'
ROW COLUMN+CELL
myrow-1 column=colfam1:q1, timestamp=1365829054040, value=value-1
myrow-2 column=colfam1:q3, timestamp=1365829066386, value=value-3
2 row(s) in 0.0330 seconds
hbase(main):011:0> exit
11)停止HBase
[hadoop@node01 logs]$ stop-hbase.sh
stopping hbase..........
hadoop@node01's password: node02: stopping zookeeper.
node03: stopping zookeeper.
node04: stopping zookeeper.
node01: stopping zookeeper.
[hadoop@node01 logs]$ jps
5030 NameNode
5259 JobTracker
5185 SecondaryNameNode
7952 Jps
[hadoop@node02 logs]$ jps
6351 Jps
4528 TaskTracker
4460 DataNode