This section describes how to use the HBase client in an O&M scenario or a service scenario.
A machine-machine user needs to download the keytab file and a human-machine user needs to change the password upon the first login.
chown user:group -R Client installation directory/HBase
cd /opt/hadoopclient
source bigdata_env
kinit Component service user
For example, kinit hbaseuser.
hbase shell
Command |
Description |
---|---|
create |
Used to create a table, for example, create 'test', 'f1', 'f2', 'f3'. |
disable |
Used to disable a specified table, for example, disable 'test'. |
enable |
Used to enable a specified table, for example, enable 'test'. |
alter |
Used to alter the table structure. You can run the alter command to add, modify, or delete column family information and table-related parameter values, for example, alter 'test', {NAME => 'f3', METHOD => 'delete'}. |
describe |
Used to obtain the table description, for example, describe 'test'. |
drop |
Used to delete a specified table, for example, drop 'test'. Before deleting a table, you must stop it. |
put |
Used to write the value of a specified cell, for example, put 'test','r1','f1:c1','myvalue1'. The cell location is unique and determined by the table, row, and column. |
get |
Used to get the value of a row or the value of a specified cell in a row, for example, get 'test','r1'. |
scan |
Used to query table data, for example, scan 'test'. The table name and scanner must be specified in the command. |