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

MasterNotRunningException when connecting to localhost standalone HBase with Java


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:








Java code:



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

		Result result = table.get(get);




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: 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 `` 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.