4 HBase 的高級 shell 管理命令
1.status
例如:顯示服務器狀態
hbase(main):058:0> status 'node01'
2.whoami
顯示 HBase 當前用戶,例如:
hbase> whoami
3.list
顯示當前所有的表
hbase> list
4.count
統計指定表的記錄數,例如:
hbase> count 'user'
5.describe
展示表結構信息
hbase> describe 'user'
6.exists
檢查表是否存在,適用于表量特別多的情況
hbase> exists 'user'
7.is_enabled、is_disabled
檢查表是否啟用或禁用
hbase> is_enabled 'user'
8.alter
該命令可以改變表和列族的模式,例如:
為當前表增加列族:
hbase> alter 'user', NAME => 'CF2', VERSIONS => 2
為當前表刪除列族:
hbase(main):002:0> alter 'user', 'delete' => 'CF2'
9.disable/enable
禁用一張表/啟用一張表
10.drop
刪除一張表,記得在刪除表之前必須先禁用
11.truncate
清空表