hbase 常用命令

2021-09-08 20:19:18 字數 793 閱讀 3721

使用「hbase shell」命令來啟動hbase的互動shell:./bin/hbase shell

退出 shell:hbase(main):021:0>exit

建立表:create 'emp','personal data',』professional data』

list:列出所有表。

禁用表:disable 'emp'。禁用表之後,仍然可以通過 list 和exists命令檢視到。無法掃瞄到它存在。scan 'emp'不可以。

檢視表是否被禁用:hbase>is_disabled 'table name'

啟用表:enable 'emp'。啟用表之後,掃瞄(scan 'emp'

)。如果能看到的模式,那麼證明表已成功啟用。

返回表說明:hbase>describe 'table name'

設定表為唯讀:hbase>alter 't1',readonly(option)【alter 'emp',readonly】

刪除列族:alter 『table name 』,『delete』=>『column family 』【

alter 'employee','delete'=>'professional'】

刪除表:hbase(main):018:0>disable 'emp'

hbase(main):019:0>drop 'emp'【先禁用後刪除】hbase>drop_all 『t.*』

【刪除匹配「regex」表】

要停止hbase:瀏覽進入到hbase主資料夾,然後用以下命令:./bin/stop-hbase.sh

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命令 描述 alter 修改列族 column family 模式 count 統計表中行的數量 create 建立表describe 顯示表相關的詳細資訊 delete 刪除指定物件的值 可以為表,行,列對應的值,另外也可以指定時間戳的值 deleteall 刪除指定行的所有...