Re: Is it possible to connect HBase remotely?
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 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. >
Re: Is it possible to connect HBase remotely?
Let me, try thanks alot On Wed, Feb 8, 2012 at 8:05 PM, N Keywal wrote: > 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. > > > -- Shashwat Shriparv
Re: Is it possible to connect HBase remotely?
Hey, I tried using what you suggested not its giving the following exception : org.apache.hadoop.hbase.ZooKeeperConnectionException: HBase is able to connect to ZooKeeper but the connection closes immediately. This could be a sign that the server has too many connections (30 is the default). Consider inspecting your ZK server logs for that error and then make sure you are reusing HBaseConfiguration as often as you can. See HTable's javadoc for more information. what may be reason. do i need to do some port related setting on the remote machine or what zookeeper configuration i need to look into on the remote machine. Regards Shashwat On Wed, Feb 8, 2012 at 8:13 PM, shashwat shriparv wrote: > Let me, try thanks alot > > > On Wed, Feb 8, 2012 at 8:05 PM, N Keywal wrote: > >> 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. >> > >> > > > > -- > Shashwat Shriparv > > > -- Shashwat Shriparv
Re: Is it possible to connect HBase remotely?
You have this with a simple client, or are you doing something more complicated? Does it work when you run it on the same machine as the hbase server? You should have a look at zookeeper logs, it may contain useful info (post them here as well :-) Someone posted this some times ago: http://www.mail-archive.com/user@hbase.apache.org/msg13488.html On Wed, Feb 8, 2012 at 3:59 PM, shashwat shriparv wrote: > Hey, > I tried using what you suggested not its giving the following exception : > > org.apache.hadoop.hbase.ZooKeeperConnectionException: HBase is able to > connect to ZooKeeper but the connection closes immediately. This could be a > sign that the server has too many connections (30 is the default). Consider > inspecting your ZK server logs for that error and then make sure you are > reusing HBaseConfiguration as often as you can. See HTable's javadoc for > more information. > > what may be reason. do i need to do some port related setting on the remote > machine or what zookeeper configuration i need to look into on the remote > machine. > > Regards > Shashwat > > On Wed, Feb 8, 2012 at 8:13 PM, shashwat shriparv < > dwivedishash...@gmail.com > > wrote: > > > Let me, try thanks alot > > > > > > On Wed, Feb 8, 2012 at 8:05 PM, N Keywal wrote: > > > >> 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. > >> > > >> > > > > > > > > -- > > Shashwat Shriparv > > > > > > > > > -- > Shashwat Shriparv >
Re: Is it possible to connect HBase remotely?
Thank you, now i am able to start the HBase in pseudo mode, and able to connect through client, i added HBase.master IP and port in hbase-site.xml, and added my domain name and ip in the client machine. Thanks and regards Shashwat On Wed, Feb 8, 2012 at 8:53 PM, N Keywal wrote: > You have this with a simple client, or are you doing something more > complicated? Does it work when you run it on the same machine as the hbase > server? > You should have a look at zookeeper logs, it may contain useful info (post > them here as well :-) > > Someone posted this some times ago: > http://www.mail-archive.com/user@hbase.apache.org/msg13488.html > > On Wed, Feb 8, 2012 at 3:59 PM, shashwat shriparv < > dwivedishash...@gmail.com > > wrote: > > > Hey, > > I tried using what you suggested not its giving the following exception : > > > > org.apache.hadoop.hbase.ZooKeeperConnectionException: HBase is able to > > connect to ZooKeeper but the connection closes immediately. This could > be a > > sign that the server has too many connections (30 is the default). > Consider > > inspecting your ZK server logs for that error and then make sure you are > > reusing HBaseConfiguration as often as you can. See HTable's javadoc for > > more information. > > > > what may be reason. do i need to do some port related setting on the > remote > > machine or what zookeeper configuration i need to look into on the remote > > machine. > > > > Regards > > Shashwat > > > > On Wed, Feb 8, 2012 at 8:13 PM, shashwat shriparv < > > dwivedishash...@gmail.com > > > wrote: > > > > > Let me, try thanks alot > > > > > > > > > On Wed, Feb 8, 2012 at 8:05 PM, N Keywal wrote: > > > > > >> 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. > > >> > > > >> > > > > > > > > > > > > -- > > > Shashwat Shriparv > > > > > > > > > > > > > > > --
Re: Is it possible to connect HBase remotely?
Pe 09.02.2012 11:47, shashwat shriparv a scris: Thank you, now i am able to start the HBase in pseudo mode, and able to connect through client, i added HBase.master IP and port in hbase-site.xml, and added my domain name and ip in the client machine. Thanks and regards Shashwat In stand alone mode I believe ZooKeeper is binding to localhost forbidding all connections from other machines and accepting just localhost so you would have to run all your apps on the same machine. In the pseudo and distribuited mode you just have to put hbase-sites.xml on the classpath and configure hbase.zookeeper.quorum property and also the hbase.zookeeper.property.clientPort if you use different port for Zk. Your application will load hbase-sites.xml from the class path and use those values to connect to Zk which tels it all the HBase machines. You can read more about the properties and the default values used to configure HBase from http://hbase.apache.org/docs/r0.20.6/hbase-conf.html. Some of them might not be available (they are for an older version) but you get an idea and some hints. As you can see the default address that Zk binds to is localhost. hbase.zookeeper.quorum my-zookeeper-machine.net Zookeeper connects to this machine. Cheers, -- Ioan Eugen Stan http://ieugen.blogspot.com