apache Hbase2.x disbale 表卡住

櫰木2年前技术文章776

1、现象

通过hbase shell disble 表,显示表已经被disable了,但是在drop table 时,又显示出现表被disable

1.png

2、分析

通过命令查看表的状态

is_disabled 'Employee'

2.png

通过原数据查看表的状态

get "hbase:meta","Employee","table:state"

3.png

一般正常情况下可以发现value为\x08\x03,正常的值是\x08\x00(Enabled)或者\x08\x01(Disabled)

https://donsnotes.com/tech/charsets/ascii.html

3、解决方法

方式1:修改表元数据
通过修改hbase meta表里面对应表的状态,这种方式目前试了一下,貌似对我这边没什么用。具体的思路如下:

  1. 修改hbase:meta 把表对应的状态置为开启或者关闭状态

hbase> put "hbase:meta","Employee","table:state",value="\b\01"
  1. 查看是否被修改

hbase> get "hbase:meta","Employee","table:state"
  1. 查看表状态

hbase> is_disabled 'Employee'
false
hbase> is_enabled 'Employee'
true
  1. 尝试drop table
    不能正常删除,还是显示表的状态为disableing

  2. 参考文档 :https://community.cloudera.com/t5/Support-Questions/Hbase-table-is-stuck-in-quot-Disabling-quot-state-Neither/m-p/235112

drop 'Employee'

方式2:通过hbase2.x 修复工具

  1. 设置表状态

./bin/hbase --config /opt/hbase/conf/ hbck -j hbase-operator-tools-1.2.0/hbase-hbck2/hbase-hbck2-1.2.0.jar setTableState  Employee DISABLED

表状态分为:enable,disable。enabling,disabling

4.png

不过在开始操作之前,最好看一下该表所有region对应的状态,否则,就算设置为DISABLE状态,在删除的时候依然不能正常删除。
2)查看当前表所有的region状态

./bin/hbase shell <<< "scan 'hbase:meta', {FILTER=>\"PrefixFilter('Employee')\"}" |grep "info:state"

5大.jpeg

  1. 如果表region状态跟你预想的不一样,可以通过HBCK2 设置region的状态

HBCK2使用

4) 删除表

6.png


相关文章

PG的统计信息(二)

1.2.4 pg_statio_user_tables 指标含义通过对pg_statio_user_tables的查询,如果heap_blks_read,idx_blks_read很高说明shared...

MySQL性能优化(三)函数运算导致无法使用索引

MySQL性能优化(三)函数运算导致无法使用索引

有时侯我们会遇到这样的情况:明明字段上已经建立了索引,但是查询还是无法使用索引。其中有一种情况是因为SQL中对索引字段进行了运算。一个例子select * from us...

从Docker拉取镜像一直失败超时?这些解决方案帮你解决烦恼

设置国内源:提示:常规方案(作用不大)阿里云提供了镜像源:https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors 登录后你会获得一个专属...

在K8S上使用Clickhouse

介绍clickhouse是一款开源的分析型数据库,性能强大。本文介绍如何在K8S环境中部署和使用clickhouse。我们使用开源的clickhouse operator: https://githu...

PromQL语法

PromQL语法

一、PromQL语法1.1、什么是PromQLPromQL(Prometheus Query Language)是 Prometheus 自己开发的表达式语言,语言表现力很丰富,内置函数也很多。使用它...

MySQL基本配置文件

MySQL基本配置文件

# 5.7  # mkdir /data/mysql57/{data,logs,run} -pv [client] port ...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。