hbase 找不到现有表 [英] hbase cannot find an existing table

查看:86
本文介绍了hbase 找不到现有表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置了一个 hbase 集群来存储来自 opentsdb 的数据.最近由于一些节点的重启,hbase 丢失了表tsdb".我仍然可以在 hbase 的主节点页面上,但是当我点击它时,它给了我一个 tableNotFoundException

I set up a hbase cluster to store data from opentsdb. Recently due to reboot of some of the nodes, hbase lost the table "tsdb". I can still it on hbase's master node page, but when I click on it, it gives me a tableNotFoundException

org.apache.hadoop.hbase.TableNotFoundException: tsdb
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegionInMeta(HConnectionManager.java:952)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:818)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:782)
    at org.apache.hadoop.hbase.client.HTable.finishSetup(HTable.java:249)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:213)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:171)
......

我进入了 hbase shell,试图定位 'tsdb' 表,但得到了类似的消息

I entered hbase shell, trying to locate 'tsdb' table, but got the similar message

hbase(main):018:0> scan 'tsdb'
ROW                                                          COLUMN+CELL

ERROR: Unknown table tsdb!

但是,当我尝试重新创建此表时,hbase shell 告诉我该表已存在...

However when I tried to re-create this table, hbase shell told me the table already exist...

hbase(main):013:0> create 'tsdb', {NAME => 't', VERSIONS => 1, BLOOMFILTER=>'ROW'}

ERROR: Table already exists: tsdb!

而且我也可以在hbase shell中列出表

And I can also list the table in hbase shell

hbase(main):001:0> list
TABLE
tsdb
tsdb-uid
2 row(s) in 0.6730 seconds

查看日志,我发现这应该是我问题的原因

Taking a look at the log, I found this which should be the cause of my issue

2012-05-14 12:06:22,140 WARN org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation: Encountered problems when prefetch META table:
org.apache.hadoop.hbase.TableNotFoundException: Cannot find row in .META. for table: tsdb, row=tsdb,,99999999999999
    at org.apache.hadoop.hbase.client.MetaScanner.metaScan(MetaScanner.java:157)
    at org.apache.hadoop.hbase.client.MetaScanner.access$000(MetaScanner.java:52)
    at org.apache.hadoop.hbase.client.MetaScanner$1.connect(MetaScanner.java:130)
    at org.apache.hadoop.hbase.client.MetaScanner$1.connect(MetaScanner.java:127)

它说在 .META. 中找不到 tsbb 行,但在 .META. 中确实有 tsdb 行.

It says cannot find row of tsbb in .META., but there are indeed tsdb rows in .META.

hbase(main):002:0> scan '.META.'
ROW                                                          COLUMN+CELL
 tsdb,x00x00x0FOxA2xF1xD0x00x00x01x00x00x0Ex00 column=info:regioninfo, timestamp=1336311752799, value={NAME => 'tsdb,x00x00x0FOxA2xF1xD0x00x00x01x00x00x0Ex00x00x02x00x00x12x00x00x03x00x00x13x00x00x
 x00x02x00x00x12x00x00x03x00x00x13x00x00x05x00 05x00x001,1336311752340.7cd0d2205d9ae5fcadf843972ec74ec5.', STARTKEY => 'x00x00x0FOxA2xF1xD0x00x00x01x00x00x0Ex00x00x02x00x00x12x00x00x03x00x00x13x00
 x001,1336311752340.7cd0d2205d9ae5fcadf843972ec74ec5.       x00x05x00x001', ENDKEY => 'x00x00x10OxA3x8Cx80x00x00x01x00x00x0Bx00x00x02x00x00x19x00x00x03x00x00x1Ax00x00x05x00x001', ENCODED => 7cd0d2205d9ae5f
                                                             cadf843972ec74ec5,}
 tsdb,x00x00x0FOxA2xF1xD0x00x00x01x00x00x0Ex00 column=info:server, timestamp=1337011527000, value=brycobapd01.usnycbt.amrs.bankofamerica.com:60020
 x00x02x00x00x12x00x00x03x00x00x13x00x00x05x00
 x001,1336311752340.7cd0d2205d9ae5fcadf843972ec74ec5.
 tsdb,x00x00x0FOxA2xF1xD0x00x00x01x00x00x0Ex00 column=info:serverstartcode, timestamp=1337011527000, value=1337011518948
......

 tsdb-uid,,1336081042372.a30d8074431c6a31c6a0a30e61fedefa.   column=info:server, timestamp=1337011527458, value=bry200163111d.usnycbt.amrs.bankofamerica.com:60020
 tsdb-uid,,1336081042372.a30d8074431c6a31c6a0a30e61fedefa.   column=info:serverstartcode, timestamp=1337011527458, value=1337011519807
6 row(s) in 0.2950 seconds

这是我在集群上运行hbck"后的结果

Here is the result after I ran "hbck" on the cluster

ERROR: Region hdfs://slave-node-1:9000/hbase/tsdb/249438af5657bf1881a837c23997747e on HDFS, but not listed in META or deployed on any region server
ERROR: Region hdfs://slave-node-1:9000/hbase/tsdb/4f8c65fb72910870690b94848879db1c on HDFS, but not listed in META or deployed on any region server
ERROR: Region hdfs://slave-node-1:9000/hbase/tsdb/63276708b4ac9f11e241aca8b56e9def on HDFS, but not listed in META or deployed on any region server
ERROR: Region hdfs://slave-node-1:9000/hbase/tsdb/e54ee4def67d7f3b6dba75a3430e0544 on HDFS, but not listed in META or deployed on any region server
ERROR: (region tsdb,x00x00x0FOxA2xF1xD0x00x00x01x00x00x0Ex00x00x02x00x00x12x00x00x03x00x00x13x00x00x05x00x001,1336311752340.7cd0d2205d9ae5fcadf843972ec74ec5.) First region should start with an empty key.  You need to  create a new region and regioninfo in HDFS to plug the hole.
ERROR: Found inconsistency in table tsdb
Summary:
  -ROOT- is okay.
    Number of regions: 1
    Deployed on:  master-node,60020,1337011518948
  .META. is okay.
    Number of regions: 1
    Deployed on:  slave-node-2,60020,1337011519845
Table tsdb is inconsistent.
    Number of regions: 5
    Deployed on:  slave-node-2,60020,1337011519845 slave-node-1,60020,1337011519807 master-node,60020,1337011518948
  tsdb-uid is okay.
    Number of regions: 1
    Deployed on:  slave-node-1,60020,1337011519807
5 inconsistencies detected.
Status: INCONSISTENT

我跑了

bin/hbase hbck -fix

不幸的是没有解决我的问题

which unfortunately does not solve my problem

谁能帮我解决这个问题

  1. 是否可以恢复这个表tsdb"?
  2. 如果 1 无法完成,是否建议优雅地删除 'tsdb' 并创建一个新的方法?
  3. 如果有人能让我知道重启节点的最推荐方法是什么,我将不胜感激?目前,我让我的主节点始终保持运行状态.对于其他节点,我会在重启后立即运行此命令.

命令:

# start data node
bin/hadoop-daemon.sh start datanode
bin/hadoop-daemon.sh start jobtracker    
# start hbase
bin/hbase-daemon.sh start zookeeper
bin/hbase-daemon.sh start regionserver 

非常感谢!

推荐答案

我不太确定为什么您无法扫描它.但是,要重新创建表,您可以尝试以下操作:

I am not very sure why you are unable to scan it. However, to recreate the table, you can try this:

1) 手动删除该表的 .META 表中的所有条目,并且

1) Delete all entries in the .META table for this table manually, and

2) 从HDFS中删除该表对应的目录

2) Delete the directory corresponding to this table from HDFS

此后再次尝试创建表.

这篇关于hbase 找不到现有表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆