hbase - single node test

1. I get some errors when setup JDK, these can be ignored.

[root@localhost tools]# rpm -ivh jdk-7u10-linux-i586.rpm
Preparing...                ########################################### [100%]
   1:jdk                    ########################################### [100%]
Unpacking JAR files...
    rt.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_10/jre/lib/rt.pack
    jsse.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_10/jre/lib/jsse.pack
    charsets.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_10/jre/lib/charsets.pack
    tools.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_10/lib/tools.pack
    localedata.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_10/jre/lib/ext/localedata.pack
    plugin.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_10/jre/lib/plugin.pack
    javaws.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_10/jre/lib/javaws.pack
    deploy.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_10/jre/lib/deploy.pack

2. set JAVA_HOME

[yuechaotian@localhost ~]$ vi .bash_profile

JAVA_HOME=/usr/java/jdk1.7.0_10
[yuechaotian@localhost ~]$ . .bash_profile
[yuechaotian@localhost ~]$ echo $JAVA_HOME
/usr/java/jdk1.7.0_10

3. startup hbase

[yuechaotian@localhost hbase-0.94.3]$ ./bin/start-hbase.sh
starting master, logging to /home/yuechaotian/tools/hbase-0.94.3/bin/../logs/hbase-yuechaotian-master-localhost.localdomain.out
[yuechaotian@localhost hbase-0.94.3]$


4. test hbase shell

[yuechaotian@localhost bin]$ hbase shell
bash: hbase: command not found
[yuechaotian@localhost bin]$ ./hbase shell
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 0.94.3, r1408904, Wed Nov 14 19:55:11 UTC 2012

hbase(main):003:0> list 'table'
TABLE                                                                                                                        
0 row(s) in 0.4020 seconds

hbase(main):004:0> create 'test', 'cf'
0 row(s) in 1.1460 seconds

--  still 0 row, why?
hbase(main):005:0> list 'table'
TABLE                                                                                                                        
0 row(s) in 0.0060 seconds
hbase(main):008:0> put 'test', 'row1', 'cf:a', 'value1'
0 row(s) in 0.0680 seconds

hbase(main):011:0> put 'test', 'row2', 'cf:b', 'value2'
0 row(s) in 0.0200 seconds

hbase(main):012:0> put 'test', 'row3', 'cf:c', 'value3'
0 row(s) in 0.0170 seconds

hbase(main):013:0> scan 'test'
ROW                              COLUMN+CELL                                                                                 
 row1                            column=cf:a, timestamp=1357702791029, value=value1                                          
 row2                            column=cf:b, timestamp=1357702910463, value=value2                                          
 row3                            column=cf:c, timestamp=1357702919765, value=value3                                          
3 row(s) in 0.0260 seconds

-- still 0 row, why?
hbase(main):014:0> list 'table'
TABLE                                                                                                                        
0 row(s) in 0.0190 seconds
hbase(main):016:0> get 'test', 'row1'
COLUMN                           CELL                                                                                        
 cf:a                            timestamp=1357702791029, value=value1                                                       
1 row(s) in 0.0080 seconds

5. exit and stop hbase
hbase(main):017:0> exit
[yuechaotian@localhost bin]$ ./stop-hbase.sh
stopping hbase..........
[yuechaotian@localhost bin]$

posted @ 2013-01-09 11:46  醇酒醉影  阅读(2327)  评论(0编辑  收藏  举报