Support Questions
Find answers, ask questions, and share your expertise

MasterNotRunningException when connecting to localhost standalone HBase with Java

Contributor

I've got a standalone HBase running on my local Windows 10 machine.  It starts up fine, I can connect to it with `hbase shell` and life is grand.

 

But connecting to it with Java has been a complete failure.  Here's my setup in brief:

hbase-site.xml

 

 

<configuration>
    <property>
        <name>hbase.master.port</name>
        <value>16000</value>
    </property>
        <property>
        <name>hbase.master.info.bindAddress</name>
        <value>localhost</value>
    </property>
    <property>
        <name>hbase.cluster.distributed</name>
        <value>false</value>
    </property>
</configuration>

 

 

 

Java code:

 

 

        Configuration configuration = HBaseConfiguration.create();
		configuration.addResource(new Path(hbaseSiteXMLPath));
        UserGroupInformation.setConfiguration(configuration);
        
		Connection connection = ConnectionFactory.createConnection(configuration);
		Table table = connection.getTable(TableName.valueOf(myTableName));

		Result result = table.get(get);
		table.close();
		connection.close();

 

 

 

This seems like it should be straightforward, but hours later I'm still getting the same Exception as I have all day:

 

 

MasterNotRunningException: org.apache.hadoop.hbase.MasterNotRunningException: java.io.IOException: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase-secure/master

 

 

I've changed `zookeeper.znode.parent` to `/hbase` but the Exception remains the same, except `/hbase-secure` changes to `/hbase`.  I've also added `hbase.zookeeper.quorum` to `localhost` and `hbase.zookeeper.property.clientPort` to 2181, but that seemed to look for an existing zookeeper connection and fail when it didn't exist rather than create a new one, so I took those out.

 

Any help appreciated, very frustrated.

0 REPLIES 0