You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by James McGlothlin <mc...@gmail.com> on 2011/05/09 22:57:14 UTC

just trying to get into HBase from java

I am able to utilize HBase from the shell with no problems.

However, I have been unable to access it from Java code.  I may very well be
making some simple error but I am at a lost as all the examples I find do it
the same way.

I have tried:

Configuration conf=  HBaseConfiguration.create();
HBaseAdmin hbase = new HBaseAdmin(conf);
HTable gicp = new HTable(conf,"GICP");

and I have tried skipping the HBaseAdmin step:

Configuration conf=  HBaseConfiguration.create();
HTable gicp = new HTable(conf,"GICP");

and I have tried adding a dset step:

conf.dset("hbase.master","localhost:60000");

While the errors appear to all be zookeeper related, they are not
consistent.

I am running hbase 0.90.1 on a 9 machine hadoop cluster.

Help would be greatly appreciated.  The conf creation always works and the
next line always fails.  I can create tables from HBase shell with no
problem.

All assistance is appreciated,

James McGlothlin
-- 
View this message in context: http://old.nabble.com/just-trying-to-get-into-HBase-from-java-tp31580562p31580562.html
Sent from the HBase User mailing list archive at Nabble.com.


Re: just trying to get into HBase from java

Posted by Ted Yu <yu...@gmail.com>.
The most important conf parameter for client to connect to HBase cluster is
hbase.zookeeper.quorum

On Mon, May 9, 2011 at 1:57 PM, James McGlothlin <mc...@gmail.com>wrote:

>
> I am able to utilize HBase from the shell with no problems.
>
> However, I have been unable to access it from Java code.  I may very well
> be
> making some simple error but I am at a lost as all the examples I find do
> it
> the same way.
>
> I have tried:
>
> Configuration conf=  HBaseConfiguration.create();
> HBaseAdmin hbase = new HBaseAdmin(conf);
> HTable gicp = new HTable(conf,"GICP");
>
> and I have tried skipping the HBaseAdmin step:
>
> Configuration conf=  HBaseConfiguration.create();
> HTable gicp = new HTable(conf,"GICP");
>
> and I have tried adding a dset step:
>
> conf.dset("hbase.master","localhost:60000");
>
> While the errors appear to all be zookeeper related, they are not
> consistent.
>
> I am running hbase 0.90.1 on a 9 machine hadoop cluster.
>
> Help would be greatly appreciated.  The conf creation always works and the
> next line always fails.  I can create tables from HBase shell with no
> problem.
>
> All assistance is appreciated,
>
> James McGlothlin
> --
> View this message in context:
> http://old.nabble.com/just-trying-to-get-into-HBase-from-java-tp31580562p31580562.html
> Sent from the HBase User mailing list archive at Nabble.com.
>
>

RE: just trying to get into HBase from java

Posted by Doug Meil <do...@explorysmedical.com>.
Read this section in the HBase book...

http://hbase.apache.org/book.html#d427e2108

"Java client configuration"


-----Original Message-----
From: James McGlothlin [mailto:mcglothlinjp@gmail.com] 
Sent: Monday, May 09, 2011 4:57 PM
To: hbase-user@hadoop.apache.org
Subject: just trying to get into HBase from java


I am able to utilize HBase from the shell with no problems.

However, I have been unable to access it from Java code.  I may very well be making some simple error but I am at a lost as all the examples I find do it the same way.

I have tried:

Configuration conf=  HBaseConfiguration.create(); HBaseAdmin hbase = new HBaseAdmin(conf); HTable gicp = new HTable(conf,"GICP");

and I have tried skipping the HBaseAdmin step:

Configuration conf=  HBaseConfiguration.create(); HTable gicp = new HTable(conf,"GICP");

and I have tried adding a dset step:

conf.dset("hbase.master","localhost:60000");

While the errors appear to all be zookeeper related, they are not consistent.

I am running hbase 0.90.1 on a 9 machine hadoop cluster.

Help would be greatly appreciated.  The conf creation always works and the next line always fails.  I can create tables from HBase shell with no problem.

All assistance is appreciated,

James McGlothlin
--
View this message in context: http://old.nabble.com/just-trying-to-get-into-HBase-from-java-tp31580562p31580562.html
Sent from the HBase User mailing list archive at Nabble.com.