hbase 建的表删除不掉的问题,已成功解决,经验分享

所用平台:hadoop 2.7.1,hbase 1.0.1.1,hbase api 1.0.1.1
发现的问题:之前在eclipse中调用api建表、填充数据、查看数据、删除数据、删除表都已经成功,但有一天同事用api建了一张表city,在hbase shell里删不掉。
我试了下,可以disable,但drop报错ERROR: Retries exhausted, it took too long to wait for the table city to be deleted.,以下是实验操作记录摘要,表名users2,供大家参考:

1
hbase(main):012:0> describe ‘users2’
2
Table users2 is ENABLED
3

4
hbase(main):013:0> disable ‘users2’
5
0 row(s) in 0.1750 seconds
6

7
hbase(main):014:0> drop ‘users2’
此处卡住很久很久,ctrl+c强制退出了,重进hbase shell继续。

1
hbase(main):002:0> describe ‘users2’
2
Table users2 is DISABLED
3

4
hbase(main):003:0> enable ‘users2’
5

6
ERROR: Table ‘users2’ not yet enabled, after 1229139ms.
7

8
Here is some help for this command:
9
Start enable of named table:
10
hbase> enable ‘t1’
11
hbase> enable ‘ns1:t1’
无法删除,那启用试试能不能操作,报错。

1
hbase(main):004:0> describe ‘users2’
2
Table users2 is ENABLED
发现实际已经启用了,禁用之后再试试删除。

1
hbase(main):009:0> drop ‘users2’
2

3
ERROR: Retries exhausted, it took too long to wait for the table users2 to be deleted.
4

5
Here is some help for this command:
6
Drop the named table. Table must first be disabled:
7
hbase> drop ‘t1’
8
hbase> drop ‘ns1:t1’
过了很久,报错:重试次数用尽,等待删除表users2用了太久的时间。
到底怎么回事,根据这些错误信息去搜索,也没有找到可用的结果,期间考虑过权限问题:

1
hbase(main):001:0> user_permission ‘city’
2
User Namespace,Table,Family,Qualifier:Permission
3

4
ERROR: DISABLED: Security features are not available
5

6
Here is some help for this command:
7
Show all permissions for the particular user.
8
Syntax : user_permission
9

10
Note: A namespace must always precede with ‘@’ character.For example:hbase> user_permission
11
hbase> user_permission ‘@ns1’
12
hbase> user_permission ‘table1’
13
hbase> user_permission ‘namespace1:table1’
14
hbase> user_permission ‘.
15
hbase> user_permission '1.

还报过各种各样的错误:

1
ERROR: org.apache.hadoop.hbase.TableNotDisabledException: city
2
at org.apache.hadoop.hbase.master.handler.EnableTableHandler.prepare(EnableTableHandler.java:121)
3
at org.apache.hadoop.hbase.master.HMaster.enableTable(HMaster.java:1601)
4
at org.apache.hadoop.hbase.master.MasterRpcServices.enableTable(MasterRpcServices.java:559)
5
at org.apache.hadoop.hbase.protobuf.generated.MasterProtos$MasterService$2.callBlockingMethod(MasterProtos.java:42430)
6
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2031)
7
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:107)
8
at org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:130)
9
at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:107)
10
at java.lang.Thread.run(Thread.java:745)
最后关闭hbase,关闭hadoop,重新打开hadoop,重新打开hbase,进入hbase shell,执行drop删除表,成功了。

1
hbase(main):011:0> describe ‘users2’
2
Table users2 is ENABLED
3

4
hbase(main):012:0> disable ‘users2’
5
0 row(s) in 1.2450 seconds
6

7
hbase(main):013:0> drop ‘users2’
8
0 row(s) in 0.4300 seconds
至此,问题已经解决。
删除同事当时发现问题的表,还是报错:

1
hbase(main):002:0> list
2
TABLE
3
city
4
test
5
2 row(s) in 0.0250 seconds
6

7
hbase(main):003:0> describe ‘city’
8
ERROR: Unknown table city!
9

10
hbase(main):004:0> desc ‘city’
11
ERROR: Unknown table city!
12

13
hbase(main):005:0> drop ‘city’
14
ERROR: Table city does not exist.
15

16
hbase(main):006:0> list
17
TABLE
18
test
19
1 row(s) in 0.0240 seconds
用list查看实际已经删掉了,问题原因基本确定:同事用api操作hbase时,可能哪里操作失误导致hbase卡住,重启hbase解决问题,本例重启了hadoop,或许不需要重启hadoop也行。
本次全部都在实验平台进行实验,生产环境请勿随意重启。


  1. A-C ↩︎

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值