hbase基本 shell命令

2021-10-04 11:30:13 字數 1109 閱讀 4886

1.啟動hbase shell命令

bin/hbase shell
2.表的操作

(1).建表語句

create 『studnet』,『info』 #這個是表名和列族

(2).新增和修改資料

put 『student』,『1001』,info:name』,『tom』

#put表名,『row key』,列族:列名』,『值』

(3).檢視表資料

get 『student』,『1001』

#get 『表名』,『row key』

get 『student』,『1001』,『info:name』

#get 『表名』,『row key』,『列族:列』

scan 『student』

#檢視所有表資料

scan 『student』,

#字典排序,包含前面,不包含前面

(3)刪除表資料

delete 『student』,『1001』,『info:name』

#刪除指定列

deleteall 『student』,『1001』

#刪除row key所有資料

truncate 『student』

#清空表資料

alter 『member』,

#刪除列族

3.namespace的操作

1)建立namespace

create_namespace 『ns_myns』

新增屬性

create_namespace 『ns_myns』,

2)檢視namespace

describe_namespace 『ns_myns』

3)檢視所有namespace

list_namespace

4)在namespcae裡面鍵表

create 『ns_myns:t_stu』, 『f1』

5)檢視namespace下的表

list_namespace_tables 『ns_myns』

Hbase 基本shell操作命令

1.建立表 hbase 建立表示要求必須確定列簇 下面建立了乙個表名字為scores的表。其中有兩個列簇,乙個是grade,乙個是course create scores grade course 2.檢視hbase中所有表 list 3 檢視表結構 describe scores 4 插入資料 向...

HBase 常用Shell命令

1.檢視hbase中存在的所有表 list hbase main list2.建立新的表 create 使用create命令來建立乙個新的表。在建立的時候,必須指定表名和列族名 hbase中的表至少有乙個列族 create hbase main create test 3.檢視表結構 describ...

HBASE 常用shell命令

1 建立表和列族 create student info address 2 向表中插入資料 put student 1 info age 20 put student 1 info name wang put student 1 info class 1 put student 1 address...