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

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