hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From matan <ma...@cloudaloe.org>
Subject Re: Connecting to standalone HBase from a remote client
Date Mon, 26 Nov 2012 15:06:40 GMT
Thanks, but hard-coding the master's IP in my client code doesn't work - I
also don't really understand why it has to be set in the client, as
according to the flow you describe, the client is getting all it needs to
know from zookeeper (?).

Doing some digging on the HBase server side, I found that
conf/regionservers has a single line containing the name 'localhost'. I
changed it to the IP of the server, and restarted hbase. However my hbase
client still thinks it should contact localhost after successfully
connecting to zookeeper....

My hbase-site.xml only contains what
http://hbase.apache.org/book.html#quickstart asked for, as seen right
below. Perhaps that's not enough?

<configuration>
<property>
    <name>hbase.rootdir</name>
    <value>file:/usr/local/hbase/hbase-0.94.2/data/hbase</value>
  </property>
  <property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>/usr/local/hbase/hbase-0.94.2/data/zookeeper</value>
  </property>
</configuration>

Kind of hoping there's a straightforward way to configure a solution.
Must be something that's always being configured when clustering, otherwise
the same problems would arise in a clustered environment, yet in my case
I'm still running a standalone instance...


On Sun, Nov 25, 2012 at 10:48 PM, Tariq [via Apache HBase] <
ml-node+s679495n4034365h78@n3.nabble.com> wrote:

> Also, add the IP and hostname of the machine running Hbase in your
> /etc/hosts file.
>
> Regards,
>     Mohammad Tariq
>
>
>
> On Mon, Nov 26, 2012 at 2:15 AM, Mohammad Tariq <[hidden email]<http://user/SendEmail.jtp?type=node&node=4034365&i=0>>
> wrote:
>
> > Sent from handheld, don't mind typos. :)
> >
> > Regards,
> >     Mohammad Tariq
> >
> >
> >
> > On Mon, Nov 26, 2012 at 2:14 AM, Mohammad Tariq <[hidden email]<http://user/SendEmail.jtp?type=node&node=4034365&i=1>>wrote:
>
> >
> >> Hello Matan,
> >>
> >>     The client first contact the zookeeper to get the region that holds
> >> the ROOt table. From ROOt, client gets the server that holds META and
> from
> >> there it gets the info about the server which actually holds the key of
> the
> >> table of interest. Your client seems to get wrong info. Please add
> these
> >> props in your client code and see it works :
> >>                 hbaseConfiguration.set("hbase.zookeeper.quorum",
> >> "192.168.2.121");
> >> hbaseConfiguration.set("hbase.zookeeper.property.clientPort","2181");
> >>  hbaseConfiguration.set("hbase.master", "192.168.2.121:60000");
> >>
> >> Change the ports and addresses as per your config.
> >>
> >> HTH
> >>
> >> Regards,
> >>     Mohammad Tariq
> >>
> >>
> >>
> >> On Mon, Nov 26, 2012 at 2:07 AM, matan <[hidden email]<http://user/SendEmail.jtp?type=node&node=4034365&i=2>>
> wrote:
> >>
> >>> Hi,
> >>>
> >>> With gracious help on this forum (from ramkrishna vasudevan) I've
> >>> managed to
> >>> setup HBase 0.94.2 in standalone mode on Ubuntu, and proceeded to
> >>> writing a
> >>> small client. I am trying to run the client from a remote server, not
> the
> >>> one where HBase is running on. It seems pretty obvious looking at both
> >>> server and client side logs, that my client successfully connects to
> >>> zookeeper, but then tries to perform the actual interaction against
> the
> >>> wrong network address. It looks like it is wrongfully trying to
> address
> >>> localhost on the HBase client side rather than addressing the server
> >>> where
> >>> HBase is installed.
> >>>
> >>> In terms of flow, I guess that zookeeper provides my client with how
> to
> >>> interact with HBase, and that it informs my client to that end that
> the
> >>> name
> >>> of the server to contact is 'localhost'. I can guess this may be
> changed,
> >>> presumably by configuring HBase on the server side. Assuming that the
> >>> correct flow should be that my client would get informed of the real
> >>> name of
> >>> the HBase server, by zookeeper. However I failed managing to configure
> >>> just
> >>> that. I tried the hbase.master property, but it had no effect.
> >>>
> >>> local HBase shell works just fine. The logs which led me to this
> analysis
> >>> follow, perhaps you will agree with my analysis. How should I change
> my
> >>> configuration to solve this? (making my client able to communicate
> with
> >>> HBase after making the zookeeper connection...).
> >>>
> >>> *Server side log:*
> >>> 2012-11-25 22:25:14,856 INFO
> >>> org.apache.hadoop.hbase.master.AssignmentManager: The master has
> opened
> >>> the
> >>> region test4,,1353836779589.bb29c037092c5d69c9efc8f13c2b2563. that was
> >>> online on localhost,58063,1353875103994
> >>> 2012-11-25 22:26:05,670 INFO
> >>> org.apache.zookeeper.server.NIOServerCnxnFactory: Accepted socket
> >>> connection
> >>> from /my-client-ip:49447
> >>> 2012-11-25 22:26:05,672 INFO
> org.apache.zookeeper.server.ZooKeeperServer:
> >>> Client attempting to establish new session at /my-client-ip:49447
> >>> 2012-11-25 22:26:05,720 INFO
> >>> org.apache.zookeeper.server.ZooKeeperServer:*
> >>> Established session 0x13b393e9d1d0004 with negotiated timeout 40000
> for
> >>> client /my-client-ip:49447*
> >>> 2012-11-25 22:27:05,354 WARN
> org.apache.zookeeper.server.NIOServerCnxn:
> >>> Exception causing close of session 0x13b393e9d1d0004 due to
> >>> java.io.IOException: Connection reset by peer
> >>> 2012-11-25 22:27:05,355 INFO
> org.apache.zookeeper.server.NIOServerCnxn:
> >>> Closed socket connection for client /my-client-ip:49447 which had
> >>> sessionid
> >>> 0x13b393e9d1d0004
> >>>
> >>> *Client side log:*
> >>> 12/11/25 22:25:51 INFO zookeeper.ZooKeeper: Initiating client
> connection,
> >>> connectString=my-hbase-server-ip:2181 sessionTimeout=180000
> >>> watcher=hconnection
> >>> 12/11/25 22:25:51 INFO zookeeper.ClientCnxn: Opening socket connection
> to
> >>> server /my-hbase-server-ip:2181
> >>> 12/11/25 22:25:51 INFO zookeeper.RecoverableZooKeeper: The identifier
> of
> >>> this process is 12372@P-Cloudaloe-01
> >>> 12/11/25 22:25:55 INFO client.ZooKeeperSaslClient: Client will not
> >>> SASL-authenticate because the default JAAS configuration section
> 'Client'
> >>> could not be found. If you are not using SASL, you may ignore this. On
> >>> the
> >>> other hand, if you expected SASL to work, please fix your JAAS
> >>> configuration.
> >>> 12/11/25 22:25:55 INFO zookeeper.ClientCnxn: Socket connection
> >>> established
> >>> to my-hbase-server-ip/my-hbase-server-ip:2181, initiating session
> >>> 12/11/25 22:25:55 INFO zookeeper.ClientCnxn: Session establishment
> >>> complete
> >>> on server my-hbase-server-ip/my-hbase-server-ip:2181, sessionid =
> >>> 0x13b393e9d1d0004, negotiated timeout = 40000
> >>> 12/11/25 22:25:57 INFO ipc.HBaseRPC: *Server at localhost/
> >>> 127.0.0.1:58063
> >>> could not be reached* after 1 tries, giving up.
> >>> 12/11/25 22:26:00 INFO ipc.HBaseRPC: Server at localhost/
> 127.0.0.1:58063
> >>> could not be reached after 1 tries, giving up.
> >>> 12/11/25 22:26:03 INFO ipc.HBaseRPC: Server at localhost/
> 127.0.0.1:58063
> >>> could not be reached after 1 tries, giving up.
> >>> 12/11/25 22:26:06 INFO ipc.HBaseRPC: Server at localhost/
> 127.0.0.1:58063
> >>> could not be reached after 1 tries, giving up.
> >>> 12/11/25 22:26:10 INFO ipc.HBaseRPC: Server at localhost/
> 127.0.0.1:58063
> >>> could not be reached after 1 tries, giving up.
> >>> 12/11/25 22:26:14 INFO ipc.HBaseRPC: Server at localhost/
> 127.0.0.1:58063
> >>> could not be reached after 1 tries, giving up.
> >>> 12/11/25 22:26:20 INFO ipc.HBaseRPC: Server at localhost/
> 127.0.0.1:58063
> >>> could not be reached after 1 tries, giving up.
> >>> 12/11/25 22:26:26 INFO ipc.HBaseRPC: Server at localhost/
> 127.0.0.1:58063
> >>> could not be reached after 1 tries, giving up.
> >>> 12/11/25 22:26:36 INFO ipc.HBaseRPC: Server at localhost/
> 127.0.0.1:58063
> >>> could not be reached after 1 tries, giving up.
> >>> 12/11/25 22:26:54 INFO ipc.HBaseRPC: Server at localhost/
> 127.0.0.1:58063
> >>> could not be reached after 1 tries, giving up.
> >>> Exception in thread "main"
> >>> org.apache.hadoop.hbase.client.NoServerForRegionException: Unable to
> find
> >>> region for myLittleHBaseTable,,99999999999999 after 10 tries.
> >>>         at
> >>>
> >>>
> org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegionInMeta(HConnectionManager.java:955)
>
> >>>         at
> >>>
> >>>
> org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:860)
>
> >>>         at
> >>>
> >>>
> org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegionInMeta(HConnectionManager.java:962)
>
> >>>         at
> >>>
> >>>
> org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:864)
>
> >>>         at
> >>>
> >>>
> org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:821)
>
> >>>         at
> >>> org.apache.hadoop.hbase.client.HTable.finishSetup(HTable.java:234)
> >>>         at
> org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:174)
> >>>         at
> org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:133)
> >>>         at HelloWorld.main(HelloWorld.java:30)
> >>>
> >>> Thanks!
> >>> matan
> >>>
> >>>
> >>>
> >>>
> >>> --
> >>> View this message in context:
> >>>
> http://apache-hbase.679495.n3.nabble.com/Connecting-to-standalone-HBase-from-a-remote-client-tp4034362.html
> >>> Sent from the HBase User mailing list archive at Nabble.com.
> >>>
> >>
> >>
> >
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-hbase.679495.n3.nabble.com/Connecting-to-standalone-HBase-from-a-remote-client-tp4034362p4034365.html
>  To unsubscribe from Connecting to standalone HBase from a remote client, click
> here<http://apache-hbase.679495.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4034362&code=bWF0YW5AY2xvdWRhbG9lLm9yZ3w0MDM0MzYyfC0xMDg3NTk1Njc3>
> .
> NAML<http://apache-hbase.679495.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://apache-hbase.679495.n3.nabble.com/Connecting-to-standalone-HBase-from-a-remote-client-tp4034362p4034395.html
Sent from the HBase User mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message