沪ICP备2021032517号-1

Hbase查询命令

  |   0 评论   |   0 浏览

balance

balance_switch true

balance_switch false

phoenix-client

格式:sqlline.py common 节点:2181端口

./sqlline.py 10.10.12.38:2181

查询数据

以下时间unix时间精确到ms

select original_message, acquisition_time, command from vehicle_original_message where id >= 'LGWFG9A69NM001491_0_01_1651835549000' and id <= 'LGWFG9A69NM001491_0_99_1651921949000' and command in (44) and instruction_type = 0 and acquisition_time >= 1651835549000 and acquisition_time <= 1651921949001 order by acquisition_time desc limit 10 offset 0;
select original_message, acquisition_time, command, create_time, device_type, instruction_type from vehicle_original_message limit 100;

查看表:

!tables

修复命令

hbase hbck -repair

设置表的TTL

desc "VEHICLE_ORIGINAL_MESSAGE"

disable "VEHICLE_ORIGINAL_MESSAGE"

alter "VEHICLE_ORIGINAL_MESSAGE",NAME=>'0',TTL=>'604800' 

enable "VEHICLE_ORIGINAL_MESSAGE"

hbase 磁盘90%会进入安全模式 hbase shell 提示 Server is not running yet

查看是否安全模式

hdfs dfsadmin -safemode get

退出安全模式

hadoop dfsadmin -safemode leave

hbase shell

查看所有表

list

删除表现将表 disable,再删除

disable 'table'
drop 'table'

清空表数据使用关键字truncate,命令为:

truncate ‘tablename’

linux shell

查看所有表大小

hdfs dfs -du -h /hbase/data/default  

标题:Hbase查询命令
作者:zifuy
地址:https://www.zifuy.cn/articles/2022/05/11/1652243338022.html