You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Sindy <si...@gmail.com> on 2010/08/02 16:21:19 UTC

standalone mode client

HI~~

I installed the hbase on one pc of linux, no hadoop, no zookeeper,
just standalone mode

now I want use hbase by it's API , I develop  java programe in eclipse
on another PC of windows, I have add hbase-site.xml in the classpth of
this pc


    Configuration config = HBaseConfiguration.create();
     HTable table = new HTable(config, "t1");
     Get g = new Get(Bytes.toBytes("r1"));
     Result r = table.get(g);
     byte [] value = r.getValue(Bytes.toBytes("f1"),
      Bytes.toBytes("name"));
     String valueStr = Bytes.toString(value);
     System.out.println("GET: " + valueStr);

the problem is:
2010-08-02 20:54:48,910 INFO  [main] zookeeper.ZooKeeperWrapper(206):
Reconnecting to zookeeper
2010-08-02 20:54:49,019 DEBUG [main] zookeeper.ZooKeeperWrapper(212):
<localhost:/hbase,org.apache.hadoop.hbase.client.HConnectionManager>Connected
to zookeeper again
2010-08-02 20:54:49,019 DEBUG [main] zookeeper.ZooKeeperWrapper(470):
<localhost:/hbase,org.apache.hadoop.hbase.client.HConnectionManager>Trying
to read /hbase/root-region-server
2010-08-02 20:54:50,269 DEBUG [main] zookeeper.ZooKeeperWrapper(473):
<localhost:/hbase,org.apache.hadoop.hbase.client.HConnectionManager>Failed
to read org.apache.zookeeper.KeeperException$ConnectionLossException:
KeeperErrorCode = ConnectionLoss for /hbase/root-region-server
2010-08-02 20:54:50,269 DEBUG [main]
client.HConnectionManager$TableServers(1077): Sleeping 5000ms, waiting
for root region.
2010-08-02 20:54:55,269 DEBUG [main] zookeeper.ZooKeeperWrapper(470):
<localhost:/hbase,org.apache.hadoop.hbase.client.HConnectionManager>Trying
to read /hbase/root-region-server
2010-08-02 20:54:58,050 DEBUG [main] zookeeper.ZooKeeperWrapper(473):
<localhost:/hbase,org.apache.hadoop.hbase.client.HConnectionManager>Failed
to read org.apache.zookeeper.KeeperException$ConnectionLossException:
KeeperErrorCode = ConnectionLoss for /hbase/root-region-server
2010-08-02 20:54:58,050 DEBUG [main]
client.HConnectionManager$TableServers(1077): Sleeping 5000ms, waiting
for root region.

I really do not know how to do.
Thanks very much :)


Sindy

Re: standalone mode client

Posted by Stack <st...@duboce.net>.
In standalone mode, hbase listens on localhost so only clients local
the hosting machine can connect to the standalone "cluster" (Confirm
by trying to telnet to the cluster machine on port 60000 -- it should
say nothing is listening).

Put up a "cluster" in pseudo-distributed mode -- see
http://hbase.apache.org/docs/current/api/overview-summary.html#distributed
-- and then your remote client, your eclipse program, should be able
to connect.

St.Ack



On Mon, Aug 2, 2010 at 7:21 AM, Sindy <si...@gmail.com> wrote:
> HI~~
>
> I installed the hbase on one pc of linux, no hadoop, no zookeeper,
> just standalone mode
>
> now I want use hbase by it's API , I develop  java programe in eclipse
> on another PC of windows, I have add hbase-site.xml in the classpth of
> this pc
>
>
>    Configuration config = HBaseConfiguration.create();
>     HTable table = new HTable(config, "t1");
>     Get g = new Get(Bytes.toBytes("r1"));
>     Result r = table.get(g);
>     byte [] value = r.getValue(Bytes.toBytes("f1"),
>      Bytes.toBytes("name"));
>     String valueStr = Bytes.toString(value);
>     System.out.println("GET: " + valueStr);
>
> the problem is:
> 2010-08-02 20:54:48,910 INFO  [main] zookeeper.ZooKeeperWrapper(206):
> Reconnecting to zookeeper
> 2010-08-02 20:54:49,019 DEBUG [main] zookeeper.ZooKeeperWrapper(212):
> <localhost:/hbase,org.apache.hadoop.hbase.client.HConnectionManager>Connected
> to zookeeper again
> 2010-08-02 20:54:49,019 DEBUG [main] zookeeper.ZooKeeperWrapper(470):
> <localhost:/hbase,org.apache.hadoop.hbase.client.HConnectionManager>Trying
> to read /hbase/root-region-server
> 2010-08-02 20:54:50,269 DEBUG [main] zookeeper.ZooKeeperWrapper(473):
> <localhost:/hbase,org.apache.hadoop.hbase.client.HConnectionManager>Failed
> to read org.apache.zookeeper.KeeperException$ConnectionLossException:
> KeeperErrorCode = ConnectionLoss for /hbase/root-region-server
> 2010-08-02 20:54:50,269 DEBUG [main]
> client.HConnectionManager$TableServers(1077): Sleeping 5000ms, waiting
> for root region.
> 2010-08-02 20:54:55,269 DEBUG [main] zookeeper.ZooKeeperWrapper(470):
> <localhost:/hbase,org.apache.hadoop.hbase.client.HConnectionManager>Trying
> to read /hbase/root-region-server
> 2010-08-02 20:54:58,050 DEBUG [main] zookeeper.ZooKeeperWrapper(473):
> <localhost:/hbase,org.apache.hadoop.hbase.client.HConnectionManager>Failed
> to read org.apache.zookeeper.KeeperException$ConnectionLossException:
> KeeperErrorCode = ConnectionLoss for /hbase/root-region-server
> 2010-08-02 20:54:58,050 DEBUG [main]
> client.HConnectionManager$TableServers(1077): Sleeping 5000ms, waiting
> for root region.
>
> I really do not know how to do.
> Thanks very much :)
>
>
> Sindy
>

Re: standalone mode client

Posted by Stack <st...@duboce.net>.
Something is odd about your environment.  Is there any more to the
below stack trace?  If you look in logs, do you see any other info on
why the HRegionServer cannot construct itself?

St.Ack

On Mon, Feb 28, 2011 at 5:49 AM, Sindy <si...@gmail.com> wrote:
> Hi,
> I am deploying Hbase-0.90 to 7 pcs.
> the hadoop have worked well on this 7pcs.
>
> I didn't install zookeeper, and choosed 3 pcs to put them in the
> zookeeper quorum of hbase-site.xml
> when I ./start-hbase.sh, It shows
>
> *Exception in thread "main" java.lang.RuntimeException: Failed construction
> of Regionserver: class org.apache.hadoop.hbase.regionserver.HRegionServer
> at
> org.apache.hadoop.hbase.regionserver.HRegionServer.constructRegionServer(HRegionServer.java:2699)
> at
> org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine.start(HRegionServerCommandLine.java:60)
> at
> org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine.run(HRegionServerCommandLine.java:75)
> at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
> at
> org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:76)
> at
> org.apache.hadoop.hbase.regionserver.HRegionServer.main(HRegionServer.java:2721)
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> *
> *How can I fix them? Thanks*
> **
> Sindy
>

Re: standalone mode client

Posted by Sindy <si...@gmail.com>.
Hi,
I am deploying Hbase-0.90 to 7 pcs.
the hadoop have worked well on this 7pcs.

I didn't install zookeeper, and choosed 3 pcs to put them in the
zookeeper quorum of hbase-site.xml
when I ./start-hbase.sh, It shows

*Exception in thread "main" java.lang.RuntimeException: Failed construction
of Regionserver: class org.apache.hadoop.hbase.regionserver.HRegionServer
at
org.apache.hadoop.hbase.regionserver.HRegionServer.constructRegionServer(HRegionServer.java:2699)
at
org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine.start(HRegionServerCommandLine.java:60)
at
org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine.run(HRegionServerCommandLine.java:75)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at
org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:76)
at
org.apache.hadoop.hbase.regionserver.HRegionServer.main(HRegionServer.java:2721)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
*
*How can I fix them? Thanks*
**
Sindy