ITPub博客

首页 > 大数据 > Hadoop > Hbase异常宕机,NoServerForRegionException: Unable to find region(2)

Hbase异常宕机,NoServerForRegionException: Unable to find region(2)

原创 Hadoop 作者:javenzhen 时间:2015-09-12 11:02:09 0 删除 编辑
1、查看META元数据表的信息
  1. hbase(main):001:0> scan '.META.'
  2. ROW COLUMN+CELL
  3.  hivetest,,1441805677008.42b9d2fff35c183 column=info:regioninfo, timestamp=1441805677121, value={NAME => 'hivetest,,1441805677008.42b9d2fff35c18393058668f77e
  4.  93058668f77e7b86e. 7b86e.', STARTKEY => '', ENDKEY => '', ENCODED => 42b9d2fff35c18393058668f77e7b86e,}
  5.  hivetest,,1441805677008.42b9d2fff35c183 column=info:server, timestamp=1441991117154, value=slave1:60020
  6.  93058668f77e7b86e.
  7.  hivetest,,1441805677008.42b9d2fff35c183 column=info:serverstartcode, timestamp=1441991117154, value=1441989279388
  8.  93058668f77e7b86e.
  9.  test,,1441718128275.edca99f7a3a627594f2 column=info:regioninfo, timestamp=1441718128579, value={NAME => 'test,,1441718128275.edca99f7a3a627594f2ab1af7e7cb1a
  10.  ab1af7e7cb1ad. d.', STARTKEY => '', ENDKEY => '', ENCODED => edca99f7a3a627594f2ab1af7e7cb1ad,}
  11.  test,,1441718128275.edca99f7a3a627594f2 column=info:server, timestamp=1441991117268, value=slave2:60020
  12.  ab1af7e7cb1ad.
  13.  test,,1441718128275.edca99f7a3a627594f2 column=info:serverstartcode, timestamp=1441991117268, value=1441989279626
  14.  ab1af7e7cb1ad.
  15. 2 row(s) in 1.3030 seconds
2、查看Hbase UI表的信息

在UI中看见之前创建的mytab表的10个region没有了,但是在hdfs中的文件任然存在
3、使用hbck的-fixAssignments尝试信息
  1. grid@master1:~$ hbase hbck -fixAssignments
  2. ..........................................................................
  3. Summary:
  4.   -ROOT- is okay.
  5.     Number of regions: 1
  6.     Deployed on: slave2,60020,1442009098829
  7.   .META. is okay.
  8.     Number of regions: 1
  9.     Deployed on: slave2,60020,1442009098829
  10.   hivetest is okay.
  11.     Number of regions: 1
  12.     Deployed on: slave1,60020,1442009098138
  13.   test is okay.
  14.     Number of regions: 1
  15.     Deployed on: slave2,60020,1442009098829
  16. 11 inconsistencies detected.
  17. Status: INCONSISTENT
  18. 15/09/11 22:17:39 INFO client.HConnectionManager$HConnectionImplementation: Closed zookeeper sessionid=0x464fbd40e2bc0008
  19. 15/09/11 22:17:39 INFO zookeeper.ClientCnxn: EventThread shut down
  20. 15/09/11 22:17:39 INFO zookeeper.ZooKeeper: Session: 0x464fbd40e2bc0008 closed
没有修复成功,检测到了11个不一致的信息。
4、再次使用hbck的-fixHdfsOrphans尝试信息
  1. grid@master1:~$ hbase hbck -fixHdfsOrphans
  2. .............................................................
  3. Summary:
  4.   -ROOT- is okay.
  5.     Number of regions: 1
  6.     Deployed on: slave2,60020,1442009098829
  7.   .META. is okay.
  8.     Number of regions: 1
  9.     Deployed on: slave2,60020,1442009098829
  10.   hivetest is okay.
  11.     Number of regions: 1
  12.     Deployed on: slave1,60020,1442009098138
  13.   test is okay.
  14.     Number of regions: 1
  15.     Deployed on: slave2,60020,1442009098829
  16. 11 inconsistencies detected.
  17. Status: INCONSISTENT
  18. 15/09/11 22:13:50 INFO client.HConnectionManager$HConnectionImplementation: Closed zookeeper sessionid=0x464fbd40e2bc0007
  19. 15/09/11 22:13:50 INFO zookeeper.ZooKeeper: Session: 0x464fbd40e2bc0007 closed
  20. 15/09/11 22:13:50 INFO zookeeper.ClientCnxn: EventThread shut down
还是没有修复成功
5、使用hbck的-repair修复
  1. grid@master1:~$ hbase hbck -repair
  2. ..............................................................
  3. Summary:
  4.   -ROOT- is okay.
  5.     Number of regions: 1
  6.     Deployed on: slave2,60020,1442009098829
  7.   .META. is okay.
  8.     Number of regions: 1
  9.     Deployed on: slave2,60020,1442009098829
  10.   hivetest is okay.
  11.     Number of regions: 1
  12.     Deployed on: slave1,60020,1442009098138
  13.   mytab is okay.
  14.     Number of regions: 11
  15.     Deployed on: slave1,60020,1442009098138 slave2,60020,1442009098829 slave3,60020,1442009098765
  16.   test is okay.
  17.     Number of regions: 1
  18.     Deployed on: slave2,60020,1442009098829
  19. 0 inconsistencies detected.
  20. Status: OK
此次修复成功,找回了mytab表。
6、再次去Hbase UI查看表的信息


太高兴了,表mytab找回来了。
7、介绍Hbase hbck的修复选项
  1. -fix,向下兼容用,被-fixAssignments替代
  2. -fixAssignments,用于修复region assignments错误
  3. -fixMeta,用于修复meta表的问题,前提是HDFS上面的region info信息有并且正确。
  4. -fixHdfsHoles,修复region holes(空洞,某个区间没有region)问题
  5. -fixHdfsOrphans,修复Orphan region(hdfs上面没有.regioninfo的region)
  6. -fixHdfsOverlaps,修复region overlaps(区间重叠)问题
  7. -fixVersionFile,修复缺失hbase.version文件的问题
  8. -maxMerge <n> (n默认是5),当region有重叠是,需要合并region,一次合并的region数最大不超过这个值。
  9. -sidelineBigOverlaps ,当修复region overlaps问题时,允许跟其他region重叠次数最多的一些region不参与(修复后,可以把没有参与的数据通过bulk load加    载到相应的region)
  10. -maxOverlapsToSideline <n> (n默认是2),当修复region overlaps问题时,一组里最多允许多少个region不参与由于选项较多,所以有两个简写的选项
  11. -repair,相当于-fixAssignments -fixMeta -fixHdfsHoles -fixHdfsOrphans -fixHdfsOverlaps -fixVersionFile -sidelineBigOverlaps
  12. -repairHoles,相当于-fixAssignments -fixMeta -fixHdfsHoles -fixHdfsOrphans

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12219480/viewspace-1797857/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-01-27

  • 博文量
    41
  • 访问量
    92969