hbase的常用命令

2021-08-24 17:50:38 字數 829 閱讀 9993

1.進入hbase shell console

2.檢視所有的表: list

3.建立表: create 't1', ,建立表名為t1的表,有乙個列族為f1,版本有5個版本,過期時間為2592000,開啟快取;

4.刪除表: 先disable 't1',在drop 't1'

5.檢視表結構:  describe 't1'

6.修改表結構: 修改之前一定要先禁用表,disable 't1',alter 'test1',,然後在enable 't1'

7.新增資料: put 't1','rowkey001','f1:col1','value01'

8.檢視某一行某一列的資料: get 't1','rowkey001', 'f1:col1'

9.檢視某一行下的所有額資料: get 't1','rowkey001'

10.掃瞄表的資料: scan 't1', ,limit表示限制條數

11.檢視表中資料的條數:  count 't1', 這個表示每1000條顯示一次,快取區為500

12.刪除某一行某一列的值: delete 't1','rowkey001','f1:col1'

13.刪除某一行的資料: deleteall 't1','rowkey001'

14.刪除整個表的資料: truncate 't1'

15.給某個使用者授予讀寫許可權: grant 'jason','rw','t1', 表示給jason 授予t1表的讀寫許可權;

16.檢視許可權:user_permission 't1',表示檢視t1表的許可權;

17.收回許可權: revoke 'jason','t1' ,收回jason使用者t1表的許可權;

Hbase常用命令

一般操作 hbase main status hbase main version 建立命名空間 namespace指的是乙個 表的邏輯分組 同一組中的表有類似的用途,相當於關係型資料庫中的database。hbase main 060 0 create namespace test1 drop n...

hbase常用命令

建立表 create 表名 列族名1 列族名2 列族名n 例子 create user info1 info2 檢視所有表 list 描述表 describe 表名 判斷表存在 exists 表名 判斷是否禁用啟用表 is enabled 表名 is disabled 表名 新增記錄 put 表名 ...

hbase 常用命令

使用 hbase shell 命令來啟動hbase的互動shell bin hbase shell 退出 shell hbase main 021 0 exit 建立表 create emp personal data professional data list 列出所有表。禁用表 disable...