hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From AnandaVelMurugan Chandra Mohan <ananthu2...@gmail.com>
Subject Issues with Java sample for connecting to remote Hbase
Date Tue, 29 May 2012 13:29:48 GMT
I have HBase version 0.92.1 running in standalone mode. I created a table
and added few rows using hbase shell. Now I am developing a standalone java
application to connect to Hbase and retrieve the data from the table.
*
This is the code I am using
*
              Configuration config = HBaseConfiguration.create();
               config.clear();
               config.set("hbase.zookeeper.quorum", "10.78.32.131");
               config.set("hbase.zookeeper.property.clientPort","2181");
               config.set("hbase.master", "10.78.32.131:60010");

               HBaseAdmin.checkHBaseAvailable(config);


               // This instantiates an HTable object that connects you to
the "myTable"
               // table.
               HTable table = new HTable(config, "asset");

               Get g = new Get(Bytes.toBytes("APU 331-350"));
               Result r = table.get(g);

*This is the content of my /etc/hosts file*

#127.0.0.1    localhost.localdomain    localhost
#10.78.32.131   honeywel-4a7632
#127.0.1.1    honeywel-4a7632
::1    honeywel-4a7632    localhost6.localdomain6    localhost6
10.78.32.131    honeywel-4a7632    localhost
*
This is part of my error stack trace*

12/05/29 18:53:33 INFO client.HConnectionManager$HConnectionImplementation:
getMaster attempt 0 of 1 failed; no more retrying.
java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at
org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
    at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:489)
    at
org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupConnection(HBaseClient.java:328)
    at
org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupIOstreams(HBaseClient.java:362)
    at
org.apache.hadoop.hbase.ipc.HBaseClient.getConnection(HBaseClient.java:1045)
    at org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:897)
    at
org.apache.hadoop.hbase.ipc.WritableRpcEngine$Invoker.invoke(WritableRpcEngine.java:150)
    at $Proxy5.getProtocolVersion(Unknown Source)
    at
org.apache.hadoop.hbase.ipc.WritableRpcEngine.getProxy(WritableRpcEngine.java:183)
    at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:303)
    at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:280)
    at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:332)
    at
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getMaster(HConnectionManager.java:642)
    at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:106)
    at
org.apache.hadoop.hbase.client.HBaseAdmin.checkHBaseAvailable(HBaseAdmin.java:1553)
    at hbaseMain.main(hbaseMain.java:27)
12/05/29 18:53:33 INFO client.HConnectionManager$HConnectionImplementation:
Closed zookeeper sessionid=0x13798c3ce190003
12/05/29 18:53:33 INFO zookeeper.ZooKeeper: Session: 0x13798c3ce190003
closed
12/05/29 18:53:33 INFO zookeeper.ClientCnxn: EventThread shut down

Can some one help me fix this? Thanks a lot.
-- 
Regards,
Anand

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message