Hi, The client needs to connect to zookeeper as well. You haven't set the parameters for zookeeper, so it goes with the default settings (localhost/2181), hence the error you're seeing. Set the zookeeper connection property in the client, it should work.
This should do it: conf .set("hbase.zookeeper.quorum", "192.168.2.122"); conf .set("hbase.zookeeper.property.clientPort", "2181"); Cheers, N. On Wed, Feb 8, 2012 at 3:26 PM, shashwat shriparv <dwivedishash...@gmail.com > wrote: > I have two machine on same network IPs are like *192.168.2.122* and * > 192.168.2.133*, suppose hbase (stand alone mode) running on *192.168.2.122, > *and i have eclipse or netbeans running on *192.168.2.133,* so i need to > retrieve and put data to hbase running on other ip, till now what i have > tried is creating a configuration for hbase inside my code like : > > Configuration conf = HBaseConfiguration.create(); > conf.set("hbase.master", "*192.168.2.122:9000*"); > HTable hTable = new HTable(conf, "table"); > > java.net.ConnectException: Connection refused > at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) > at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:567) > at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119) > 12/02/08 19:44:28 INFO zookeeper.ClientCnxn: Opening socket connection to > server* localhost/127.0.0.1:2181* > 12/02/08 19:44:28 WARN zookeeper.ClientCnxn: Session 0x1355d44ae6f0003 for > server null, unexpected error, closing socket connection and attempting > reconnect > > I a not able to understand why its trying to go to *localhost/ > 127.0.0.1:2181 > .* > * > * > My host file configuration is follows : > > > ========================================================================================================================== > 127.0.0.1 localhost > 127.0.0.1 ubuntu.ubuntu-domain ubuntu > 192.168.2.126 ubuntu > 192.168.2.125 ubuntu1 > 192.168.2.106 ubuntu2 > 192.168.2.56 ubuntu3 > > # The following lines are desirable for IPv6 capable hosts > ::1 ip6-localhost ip6-loopback > fe00::0 ip6-localnet > ff00::0 ip6-mcastprefix > ff02::1 ip6-allnodes > ff02::2 ip6-allrouters > > ========================================================================================================================== > I am able to telnet to localhost:9000, 127.0.0.1:9000, myhostname:9000, > but > if i am trying to connect to my ip which is 1982.168.2.125 its not > connecting : its saying connection reffused. > > What method should follow to achieve this(connect to HBase running on > another pc on the same network). any tutorial link will be appreciated. >