修复hbase Shell里面的list命令不可用
进入Hbase Shell
hbase shell
使用list命令查看所有表时报错
hbase(main):001:0> list
TABLE
ERROR: Can't get master address from ZooKeeper; znode data == null
Here is some help for this command:
Show cluster status. Can be 'summary', 'simple', 'detailed', or 'replication'. The
default is 'summary'. Examples:
hbase> status
hbase> status 'simple'
hbase> status 'summary'
hbase> status 'detailed'
hbase> status 'replication'
hbase> status 'replication', 'source'
hbase> status 'replication', 'sink'
重启Hbase
cd hbase-1.2.0-cdh5.7.0
bin/start-hbase.sh
重启后依旧报错,此时先关闭Hbase集群
bin/stop-hbase.sh
stopping hbase...................
执行修复metadata命令
hbase org.apache.hadoop.hbase.util.hbck.OfflineMetaRepair #hbase集群关闭状态下运行
进入zookeeper command
bin/zkCli.sh
[zk: localhost:2181(CONNECTED) 0] ls /
[consumers, solr, yarn-leader-election, spark, controller_epoch, isr_change_notification, hbase, hadoop-ha, zookeeper, admin, config, kafka-manager, brokers]
[zk: localhost:2181(CONNECTED) 1] rmr /hbase
重启hbase集群
bin/start-hbase.sh
此时可以正常使用hbase shell,但是还有一个问题就是每次启动hbase的时候总会提示如下:
master running as process 12422. Stop it first.
第二种方案
如果第一种方案无法修复,那么就是第二种方案吧
在使用 Hbase shell 时,一直报错。花了半个多小时解决这个问题。解决如下:
1. 关闭Hadoop集群。
2. 格式化hdfs 进入Hadoop目录下 :
bin/hdfs namenode -format //丢数据
3. 启动 hadoop集群
4. 启动 hbase集群
5. hbase shell
status
报错Found inconsistency in table hbase:namespace**
ERROR: (region hbase:namespace,,1517480288768.ab4a22852177a867ae631aa109fe2b81.) Multiple regions have the same startkey:
ERROR: (region hbase:namespace,,1523276566308.73f980027b0b2d3badb4627dc1fc5c67.) Multiple regions have the same startkey:
2018-04-27 12:30:33,387 WARN [main] util.HBaseFsck: reached end of problem group: null
ERROR: Found inconsistency in table hbase:namespace
解决方案:
hbase hbck 检查 #集群开启状态下运行
hbase hbck -fix 修复 #集群开启状态下运行
hbck是hbase里用来检测 region一致性,表完整性问题及修复损坏的命令行工具。
hadoop 数据检查:
hdfs fsck /
删除hadoop丢失的数据
hdfs fsck / -delete
hbase数据检查
hbase fsck
报错
ERROR: There is a hole in the region chain between and . You need to create a new .regioninfo and region dir in hdfs to plug the hole.
ERROR: Found inconsistency in table hbase:meta
评论前必须登录!
注册