HBase Error – assignment of -ROOT- failure – Cant connect to web interface

A while back there was an issue with getting Hadoop and HBase from Cloudera (CDH3) running on Ubuntu Natty (11.04).

This error occurs when you try to go to http://localhost:60010 – it just sits there continually loading. You should be able to get to the region server/s without issue – http://localhost:60030

Looking at the log file revealed that HBase could not connect to the Root region:

11/05/15 19:58:27 WARN master.AssignmentManager: Failed assignment of -ROOT-,,0.70236052 to serverName=localhost,60020,1305452402149, load=(requests=0, regions=0, usedHeap=24, maxHeap=995), trying to assign elsewhere instead; retry=0 org.apache.hadoop.hbase.client.RetriesExhaustedException:
Failed setting up proxy interface org.apache.hadoop.hbase.ipc.HRegionInterface to /127.0.0.1:60020 after attempts=1 at org.apache.hadoop.hbase.ipc.HBaseRPC.waitForProxy(HBaseRPC.java:355) at
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getHRegionConnection(HConnectionManager.java:957) at org.apache.hadoop.hbase.master.ServerManager.getServerConnection
(ServerManager.java:606) at org.apache.hadoop.hbase.master.ServerManager.sendRegionOpen(ServerManager.java:541) at org.apache.hadoop.hbase.master.AssignmentManager.assign(AssignmentManager.java:901) at
org.apache.hadoop.hbase.master.AssignmentManager.assign(AssignmentManager.java:730) at org.apache.hadoop.hbase.master.AssignmentManager.assign(AssignmentManager.java:710) at
org.apache.hadoop.hbase.master.AssignmentManager$TimeoutMonitor.chore(AssignmentManager.java:1605) at org.apache.hadoop.hbase.Chore.run(Chore.java:66) Caused by: java.net.ConnectException: Connection refused at
sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:567) at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206) at
org.apache.hadoop.net.NetUtils.connect(NetUtils.java:408) at org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupIOstreams(HBaseClient.java:328) at org.apache.hadoop.hbase.ipc.HBaseClient.getConnection
(HBaseClient.java:883) at org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:750) at org.apache.hadoop.hbase.ipc.HBaseRPC$Invoker.invoke(HBaseRPC.java:257) at $Proxy6.getProtocolVersion(Unknown Source) at
org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:419) at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:393) at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:444) at
org.apache.hadoop.hbase.ipc.HBaseRPC.waitForProxy(HBaseRPC.java:349) ... 8 more 11/05/15 19:58:27 WARN master.AssignmentManager: Unable to find a viable location to assign region -ROOT-,,0.70236052

To fix this the issue is probably  a problem with the hosts file (/etc/hosts). You need to remove entries relating to 127.0.1.1 COMPNAME – just put a hash (#) in front of this line and then restart all hadoop and hbase services. You should now see that you can get to the HBase web UI on default port 60010. You should also see that you can get access to HBase via Hive and the Hue web interface if you are using it.

The other option if you cannot edit the hosts file is  to force HBase to use IPv4.

In conf/hadoop-env.sh add the following line:

export HADOOP_OPTS=-Djava.net.preferIPv4Stack=true