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

version


此命令返回系统中使用的 HBase 版本。它的语法如下:

hbase(main):010:0> version

如果执行此命令,它将返回以下输出。

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

表帮助


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

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