HBase(1)-通用命令

启动HBase shell

进入HBase安装目录bin目录,启动cmd,输入hbase shell 

D:\Soft\hbase-1.2.6\bin>hbase shell

状态命令

hbase(main):001:0> status
1 active master, 0 backup masters, 1 servers, 1 dead, 3.0000 average load

版本命令

hbase(main):002:0> version
1.2.6, rUnknown, Mon May 29 02:25:32 CDT 2017

用户信息

hbase(main):003:0> whoami
admin (auth:SIMPLE)
    groups: Administrators

表操作提示

hbase(main):004: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'

Or, if you have already created the table, you can get a reference to it:

   hbase> t = get_table 't'

You can do things like call 'put' on the table:

  hbase> t.put 'r', 'cf:q', 'v'

which puts a row 'r' with column family 'cf', qualifier 'q' and value 'v' into table t.

To read the data out, you can scan the table:

  hbase> t.scan

which will read all the rows in table 't'.

Essentially, any command that takes a table name can also be done via table reference.
Other commands include things like: get, delete, deleteall,
get_all_columns, get_counter, count, incr. These functions, along with
the standard JRuby object methods are also available via tab completion.

For more information on how to use each of these commands, you can also just type:

   hbase> t.help 'scan'

which will output more information on how to use that command.

You can also do general admin actions directly on a table; things like enable, disable,
flush and drop just by typing:

   hbase> t.enable
   hbase> t.flush
   hbase> t.disable
   hbase> t.drop

Note that after dropping a table, your reference to it becomes useless and further usage
is undefined (and not recommended).

 

 

你可能感兴趣的:(大数据)