The inspiration for this post on the HBase Error “Error: Can’t get master address from ZooKeeper” came from my work on the HBase Creating a Table blog post. Here is the quick and easy way to check for this error.
Why Does This Always Happen?
When working in HBase it happens all the time and each time I spend too much time troubleshooting. It’s the “Error: Can’t get master address from ZooKeeper; znode data == null” error. Normally the first thing I do is look at the HBase configuration file or Google the error so see how to change the Zookeeper configurations. All these are good options but 9 times out of 10 it’s a simple answer I should check first.
The very first thing I should always do is check Ambari to ensure the services are running correctly and if not just restart. Especially when working in the sandbox or development environments that are not always up and running.
Checking Ambari
The first step should be to log into Ambari Server. If you aren’t familiar with Ambari it’s a Management portal for Hadoop and used in the Hortonworks Data Platform (HDP). Ambari allows administrators to install, manage and monitor Hadoop clusters with a simple Web interface. If you are using the sandbox or a default HDP deployment navigate to localhost:8080 in your browser.
After logging in check on the left side of the screen for HBase. Green means running and error free. Red means not running or errors present. Click on HBase to open up HBase configurations.
In the summary tab click on the HBase Master to drill down into the errors. In the above screen you can see my problem, the HBase Master has been stopped. You can click on the errors to see a more detail description of the errors. However in my case all these errors are present because the HBase Master in down.
For some reason every time I reboot the HDP cluster HBase has to be manually restarted. Of course I never remember that point hence why I’m writing this post. I figure if it’s something that happens to me it must be happening to others.
Solved Quick & Easy
Easy solution solved by just logging into the Ambari and rebooting the HBase services. Sounds simple but easily forgotten when the HBase shell still works. Once the services have been rebooted and are running look for the “Green”. If the HBase is stilling showing “Red” check other services that are related or jump right in and troubleshoot the Zookeeper instance. Check back later for a deep dive into ZooKeeper troubleshoot.