首页 > 代码库 > Hbase初体验
Hbase初体验
搭建local模式搭建,
官网:http://hbase.apache.org
API:http://hbase.apache.org/apidocs/index.html
download:http://www.apache.org/dyn/closer.cgi/hbase/
启动报错,提示javahome未设置,修改文件:/jason/hbase-0.98.5-hadoop2/bin/hbase-config.sh
export JAVA_HOME=/jason/jdk
export PATH=$JAVA_HOME/bin:$PATH
如图:
启动hbase:
./start-hbase.sh
执行hbase shell
./hbase shell
2014-09-04 11:03:34,508 INFO [main] Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.availableHBase Shell; enter ‘help<RETURN>‘ for list of supported commands.Type "exit<RETURN>" to leave the HBase ShellVersion 0.98.5-hadoop2, rUnknown, Mon Aug 4 23:58:06 PDT 2014hbase(main):001:0> status2014-09-04 11:03:46,570 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable1 servers, 0 dead, 2.0000 average loadhbase(main):002:0> create ‘testtable‘,‘colfam1‘0 row(s) in 0.4120 seconds=> Hbase::Table - testtablehbase(main):003:0> list ‘testtable‘TABLE testtable 1 row(s) in 0.0400 seconds=> ["testtable"]hbase(main):004:0> put ‘testtable‘,‘myrow-1‘,‘colfam1‘,‘value-1‘0 row(s) in 0.1550 seconds
hbase(main):008:0> scan ‘testtable‘
ROW COLUMN+CELL
myrow-1 column=colfam1:, timestamp=1409809952315, value=http://www.mamicode.com/value-1
1 row(s) in 0.0560 seconds
Hbase初体验