I downloaded hortonworks vm HDP 2.5 for virtualbox. I have set it up right and i can hit the browser on my windows and can use ambari, hbase etc. my primary purpose for this installation is to use hbase. I can ssh into vm and do hbase shell operations to create tables and do all operations. Now I want to write a client program on windows to interact with this hbase on vm. So i wrote a simple program that connects to hbase and list tables. But I am getting errors. As I can see from logs it can connect to zoo keeper but after that i get an error saying - “java.io.IOException: An established connection was aborted by the software in your host machine” and " org.apache.hadoop.hbase.MasterNotRunningException:com.google.protobuf.ServiceException: org.apache.hadoop.hbase.ipc.FailedServerException: This server is in the failed servers list: sandbox.hortonworks.com/127.0.0.1:16000" and “ERROR [run-main-0-EventThread] zookeeper.ClientCnxn: EventThread shut down”.
I have hbase-site.xml file set in my classpath and i can see it reads the right parameters. I can also telnet onto these ports from my windows machine and reach them. I have searched on google but the solutions people provided hasn’t worked for me like commenting out localhost line in etc/hosts on virtual box or matching client libraries to HDP distribution libraries.
Below is my code to conenct to hbase:
val conf = HBaseConfiguration.create(); // parameters are loaded from file hbase-site.xml. I print the parameters to see they are loaded right.
val connection = ConnectionFactory.createConnection(conf);
val admin = connection.getAdmin();
val listtables = admin.listTables()
I believe it can reach zookeeper from my windows machine as i can see from logs connection established,
but then it says Hbase Master is not running and I can see it is reaching the right host for hbase master too(sandbox.hortonworks.com/127.0.0.1:16000). I can see from UI hbase master and regions servers are running at this host and port. still i get the above mentioned errors like master not running.
I am using Hortonworks HDP 2.5 and
client libraries “org.apache.hbase” % “hbase-client” % “126.96.36.199.5.0.0-1245” and “org.apache.hadoop” % “hadoop-client” % “188.8.131.52.5.0.0-1245”. I am using these client versions only to match whats on HDP 2.5. I have also attached screenshot of errors I am getting.
Any help is much appreciated. Thanks in advance.