二、hbase shell操作hbase server。
1. hbase client环境
${hbase_home} $ cat conf/hbase-site.xml
2. hbase shell使用
${hbase_home} $ bin/hbase shell
or HBASE_CONF_DIR="conf/hbase-site-test.xml" bin/hbase shell
3. 常用语句
帮助语句:
help "command"
系统信息语句:
status 'detailed'
定义语句:
create 'test_ascii', { NAME => 'i', BLOOMFILTER => 'ROW' }
disable 'test_ascii'
alter 'test_ascii', { NAME => 'i', BLOOMFILTER => 'ROW', COMPRESSION=>'GZ' }
drop 'test_ascii'
操作语句:
put 'test_ascii', '10001_1', 'i:id', 1
put 'test_ascii', '10001_1', 'i:uid', 10001
delete 'test_ascii','10001_1'
查看语句:
list
describe 'test_ascii'
count 'test_ascii'
查询语句:
scan 'test_ascii'
scan 'test_ascii', {LIMIT =>10, STARTROW => '10001_1', STOPROW=>'10001_1~'}
get 'test_ascii', '10001_1', {COLUMN => 'i:uid'}
get 'test_ascii', org.apache.hadoop.hbase.util.Bytes.toStringBinary(org.apache.hadoop.hbase.util.Bytes.toBytes("10001_1"))
http://hadoop.apache.org/common/docs/current/api/overview-summary.html#overview_description
http://hbase.apache.org/book.html#configuration
hbase client api guide:http://wiki.apache.org/hadoop/UsingLzoCompression
http://www.packtpub.com/article/hbase-basic-performance-tuning
cloudera docs:
http://blog.cloudera.com/blog/2012/07/hbase-log-splitting/
http://blog.cloudera.com/blog/2012/06/hbase-io-hfile-input-output/
http://blog.cloudera.com/blog/2012/06/hbase-write-path/
http://blog.cloudera.com/blog/2012/01/caching-in-hbase-slabcache/
http://blog.cloudera.com/blog/2011/02/avoiding-full-gcs-in-hbase-with-memstore-local-allocation-buffers-part-1/