Introduction
I ran into an annoying error in HBase due to the localhost loopback. The solution was simple, but took some trial and error.
Error
I was following the HBase logs with the following command:
tail -1000f /var/log/hbase/hbase-hbase-master-freshstart.log
The following error kept poping up in the log file.
org.apache.hadoop.hbase.master.AssignmentManager: Unable to find a viable location to assign region -ROOT
Solution
sudo vi /etc/hosts
I changed:
127.0.0.1 localhost
127.0.1.1 freshstart
to:
#127.0.0.1 localhost
#127.0.1.1 freshstart
192.168.2.15 freshstart
127.0.0.1 localhost
192.168.2.15 is my internal IP address, and freshstart is my hostname.
At this point I rebooted as a quick and dirty way to restart all Hadoop / HBase services. Alternatively, you can start/stop all services.
Additional Thoughts
Updating the hosts file is an option for me currently since I have everything installed on a single machine. However, it seems that this error is a name resolution related issue, so a properly configured DNS server is likely necessary when deploying Hadoop / HBase in a production cluster.
