1) General HBase shell commands
status | Show cluster status. Can be ‘summary’, ‘simple’, or ‘detailed’. The default is ‘summary’. hbase> status |
version | Output this HBase versionUsage: hbase> version |
whoami | Show the current hbase user.Usage: hbase> whoami |
2) Tables Management commands
alter | Alter column family schema; pass table name and a dictionary specifying new column family schema. Dictionaries are described on the main help command output. Dictionary must include name of column family to alter.For example, to change or add the ‘f1′ column family in table ‘t1′ from current value to keep a maximum of 5 cell VERSIONS, do: hbase> alter ‘t1′, NAME => ‘f1′, VERSIONS => 5 You can operate on several column families: hbase> alter ‘t1′, ‘f1′, {NAME => ‘f2′, IN_MEMORY => true}, {NAME => ‘f3′, VERSIONS => 5} To delete the ‘f1′ column family in table ‘t1′, use one of:hbase> alter ‘t1′, NAME => ‘f1′, METHOD => ‘delete’ You can also change table-scope attributes like MAX_FILESIZE, READONLY, hbase> alter ‘t1′, MAX_FILESIZE => ‘134217728’ You can add a table coprocessor by setting a table coprocessor attribute: hbase> alter ‘t1′, Since you can have multiple coprocessors configured for a table, a The coprocessor attribute must match the pattern below in order for [coprocessor jar file location] | class name | [priority] | [arguments] You can also set configuration settings specific to this table or column family: hbase> alter ‘t1′, CONFIGURATION => {‘hbase.hregion.scan.loadColumnFamiliesOnDemand’ => ‘true’} You can also remove a table-scope attribute: hbase> alter ‘t1′, METHOD => ‘table_att_unset’, NAME => ‘MAX_FILESIZE’ hbase> alter ‘t1′, METHOD => ‘table_att_unset’, NAME => ‘coprocessor$1′ There could be more than one alteration in one command: hbase> alter ‘t1′, { NAME => ‘f1′, VERSIONS => 3 }, |
create | Create table; pass table name, a dictionary of specifications per column family, and optionally a dictionary of table configuration. hbase> create ‘t1′, {NAME => ‘f1′, VERSIONS => 5} Table configuration options can be put at the end. |
describe | Describe the named table.
|