hbase 常見操作

2022-05-08 14:51:08 字數 1219 閱讀 8707

hbase 常見操作:
#

新建表 fs與 fs2 為列族

create '

s1','

fs','

fs2'

'''blockcache : 讀快取

blocksize : 快取塊大小

inmemory: 是否在快取在記憶體

常見表操作
#

新增 s1 表中 rowkey 為 '11111', 的 name值為 xiaohong

put '

s1','

11111

', '

fs:name

','xiaohong'#

修改 s1 表中 rowkey 為 '11111', 的 name值為 xiaoming

#此時並沒有刪除 ,只是 失效標記

put '

s1','

11111

', '

fs:name

','xiaoming'#

刪除 s1 表中 rowkey 為 '11111', 的 name 列

delete '

s1' ,'

11111

', '

fs:name

#清除表所有資料

truncate 's1'

#檢視命名空間(scahme)

list_namespace

檢視 物理表資訊 與實際儲存位置(在 hbase-site.xml 之中配置,此時配在了 hdfs 之中, 你可以 linux 目錄之中)
#

檢視 物理表資訊

hbase hfile -p -f /hbase/data/default/s1/83f2405736f2a9350c4b821a602b50ac/fs/eb23d2e409964b5a9619ce0eff2c020d

#檢視實際儲存位置

HBase 常見 shell 操作

檢視當前所有表 list 建立表 create table name column family 刪除列族 alter table name delete columnfamily 檢視表內容 list table name 檢視表描述 describe table name 插入資料 put ta...

Hbase 二 Hbase常用操作

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

Hbase 常見問題

master 在hbase中的角色 分配region給region server,和regionserver的負載均衡 zookeeper在hbase中的角色 儲存配置資訊,分布式同步,負責客戶端和region server交流 hregionserver在hbase中的角色 響應資料讀寫,管理re...