HBase - 通用命令

HBase中的常规命令是status,version,table_help和whoami.本章介绍了这些命令.

status

此命令返回系统状态,包括系统上运行的服务器的详细信息.其语法如下:

hbase(main):009:0> status

如果执行此命令,则返回以下输出.

hbase(main):009:0> status
3 servers, 0 dead, 1.3333 average load

版本

此命令返回版本您系统中使用的HBase.其语法如下:

hbase(main):010:0> version

如果执行此命令,则返回以下输出.

hbase(main):009:0> version
0.98.8-hadoop2, r6cfc8d064754251365e070a10a82eb169956d5fe, Fri Nov 14
18:26:29 PST 2014

table_help

此命令指导您使用表引用命令的内容和方式.下面给出了使用此命令的语法.

hbase(main):02:0> table_help

使用此命令时,它显示与表相关的命令的帮助主题.下面给出的是该命令的部分输出.

hbase(main):002:0> table_help
Help for table-reference commands.
You can either create a table via 'create' and then manipulate the table
via commands like 'put', 'get', etc.
See the standard help information for how to use each of these commands.
However, as of 0.96, you can also get a reference to a table, on which
you can invoke commands.
For instance, you can get create a table and keep around a reference to
it via:
 hbase> t = create 't', 'cf'…...

whoami

此命令返回HBase的用户详细信息.如果执行此命令,则返回当前HBase用户,如下所示.

hbase(main):008:0> whoami
hadoop (auth:SIMPLE)
groups: hadoop