1. Error Description:
The reason for this error is that I have previously installed the CDH in Cloudera Manager, which adds all the services and, of course, hbase. And then reinstall, the following error occurs:
Failed to become active master,org.apache.hadoop.hbase.tableexistsexception:hbase:namespace.
According to the above error we can clearly know that, when starting HBase, because the previously installed HBase version of the data also exists, so the re-installed HBase will report tableexistsexception exception. Causes HBase to fail to start.
Also, previous versions of HBase's data are stored in zookeeper and therefore need to be viewed by zookeeper clients.
2, the solution
(1) Stop hbase, this step should be ignored, because you do not start at all, so there is no stopping.
(2) Find the location of the zookeeper component that Clouderamanager automatically installs
We know that all of the CDH components installed by Cloudera company are in the/opt/cloudera/parcels/cdh-5.4.4-1.cdh5.4.4.p0.4/lib/directory by default. So
The Zookeeper installation directory is:/opt/cloudera/parcels/cdh-5.4.4-1.cdh5.4.4.p0.4/lib/zookeeper
(3) Enter the bin directory of the Zookeeper installation directory:
/opt/cloudera/parcels/cdh-5.4.4-1.cdh5.4.4.p0.4/lib/zookeeper/bin
(4) Execute the following command:
./zkcli.sh, the shell interface of the zookeeper client is entered. and executing the LS/command in the Shell interface, the following appears:
From what we can see, there is hbase data in zookeeper, so we just need to delete hbase.
(5) Execute Delete: rmr/hbase
(6) Restart HBase.
It's OK.
When you start hbase with Clouderamanager, Master appears. Tablenamespacemanager:namespace table not found. Creating ...