Support Questions

Find answers, ask questions, and share your expertise

hbase connection using java issue,without configuration setting in code

Explorer

error:

17/02/08 14:59:32 INFO client.HConnectionManager$HConnectionImplementation: ZooKeeper available but no active master location found 17/02/08 14:59:32 INFO client.HConnectionManager$HConnectionImplementation: getMaster attempt 0 of 10 failed; retrying after sleep of 1000 org.apache.hadoop.hbase.MasterNotRunningException

program:

public static void main(String[] args) throws IOException{

Configuration conf = HBaseConfiguration.create();

HBaseAdmin admin = new HBaseAdmin(conf);

}

2 REPLIES 2

Super Guru
@vinayaka shettigar

Is your HMaster running? Can you please check HMaster logs? Are you passing hbase-site.xml to your HBase conf (not clear from the code you shared)?

Super Collaborator

1. Please check, that the /etc/hbase/conf is in the classpath or set HBASE_CONF_DIR env to this path (I expect that you are running it on the node where hbase client is deployed, otherwise copy it from your cluster to the node where client is running).

2. Before running a custom application make sure that you are able to access HBase using the regular hbase shell. If it doesn't work, check Ambari UI that both master and region servers are running

3. Not necessary, but recommended to build your application with HDP HBase libraries. For maven include the HDP repo into your project

    <repository>
      <id>public</id>
      <name>hwx</name>
      <url>http://nexus-private.hortonworks.com/nexus/content/groups/public/</url>
    </repository>

and set the corresponding version for HBase libraries like 1.1.2.2.5.0.0-1245 (for HDP 2.5)

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.