文档地址:
http://hbase.apache.org/book.html#shell
1、基本用法:help功能结合exercises练习和说明文档使用
练习地址:http://hbase.apache.org/book.html#shell_exercises
说明文档地址:https://learnhbase.wordpress.com/2013/03/02/hbase-shell-commands/
tip:说明文档打开较慢,13年的文档了,复制出来方便查看
https://blog.youkuaiyun.com/lucasmaluping/article/details/117696992
$ ./bin/hbase shell
Type help and then <RETURN> to see a listing of shell commands and options. Browse at least the paragraphs at the end of the help output for the gist of how variables and command arguments are entered into the HBase shell; in particular note how table names, rows, and columns, etc., must be quoted.
See shell exercises for example basic shell operation.
Here is a nicely formatted listing of all shell commands by Rajeshbabu Chintaguntla.
2、脚本使用
Running the Shell in Non-Interactive Mode
To invoke non-interactive mode, pass the -n or --non-interactive option to HBase Shell.
HBase Shell in OS Scripts
$ echo "describe 'test1'" | ./hbase shell -n
Version 0.98.3-hadoop2, rd5e65a9144e315bb0a964e7730871af32f5018d5, Sat May 31 19:56:09 PDT 2014
describe 'test1'
DESCRIPTION ENABLED
'test1', {NAME => 'cf', DATA_BLOCK_ENCODING => 'NON true
E', BLOOMFILTER => 'ROW', REPLICATION_SCOPE => '0',
VERSIONS => '1', COMPRESSION => 'NONE', MIN_VERSIO
NS => '0', TTL => 'FOREVER', KEEP_DELETED_CELLS =>
'false', BLOCKSIZE => '65536', IN_MEMORY => 'false'
, BLOCKCACHE => 'true'}
1 row(s) in 3.2410 seconds
To suppress all output, echo it to /dev/null:
$ echo "describe 'test'" | ./hbase shell -n > /dev/null 2>&1
Checking for Success or Failure In Scripts
$ echo "describe 'test'" | ./hbase shell -n > /dev/null 2>&1
1万+

被折叠的 条评论
为什么被折叠?



