HBase: Unable to start Master: TableExistsException: hbase:namespace

I recreated an HBase service on one of my clusters and on start received a TableExistsException error:

Error:

org.apache.hadoop.hbase.master.TableNamespaceManager
Namespace table not found. Creating...
Jul 21, 1:23:40.026 PM    FATAL   org.apache.hadoop.hbase.master.HMaster
Failed to become active master
org.apache.hadoop.hbase.TableExistsException: hbase:namespace
at org.apache.hadoop.hbase.master.handler.CreateTableHandler.checkAndSetEnablingTable(CreateTableHandler.java:152)
at org.apache.hadoop.hbase.master.handler.CreateTableHandler.prepare(CreateTableHandler.java:125)
at org.apache.hadoop.hbase.master.TableNamespaceManager.createNamespaceTable(TableNamespaceManager.java:233)
...
Jul 21, 1:23:40.026 PM    FATAL   org.apache.hadoop.hbase.master.HMaster
Master server abort: loaded coprocessors are: []
Jul 21, 1:23:40.026 PM    FATAL   org.apache.hadoop.hbase.master.HMaster
Unhandled exception. Starting shutdown.
org.apache.hadoop.hbase.TableExistsException: hbase:namespace
at org.apache.hadoop.hbase.master.handler.CreateTableHandler.checkAndSetEnablingTable(CreateTableHandler.java:152)
at org.apache.hadoop.hbase.master.handler.CreateTableHandler.prepare(CreateTableHandler.java:125)
at org.apache.hadoop.hbase.master.TableNamespaceManager.createNamespaceTable(TableNamespaceManager.java:233)
...
Jul 21, 1:23:40.027 PM    INFO      org.apache.hadoop.hbase.regionserver.HRegionServer
STOPPED: Unhandled exception. Starting shutdown.

 

Resolution: ZooKeeper stores metadata from the previous setup. Clear this and restart.

Clear ZK znode:


zookeeper-client

rmr /hbase

ONLY if needed, clear the HBase data from HDFS – ONLY DO THIS IF ABSOLUTELY NECESSARY AS ALL HBASE DATA WILL BE LOST:


sudo -u hdfs hadoop fs -rm -r /hbase/*

Reference: https://community.cloudera.com/t5/Storage-Random-Access-HDFS/HBase-Master-Failed-to-become-active-master/td-p/27186/page/2

Leave a Reply