You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by ma qiang <ma...@gmail.com> on 2008/05/24 03:19:06 UTC
How to access data from HBase on Tomcat ?
Hi all,
In my web app based on Tomcat, the server read data from HBase
then return these to client as a response. , Who can tell me how?
Thank you very much!
Best wishes !
maqiang
Re: How to access data from HBase on Tomcat ?
Posted by stack <st...@duboce.net>.
ma qiang wrote:
> Yes, I can.
Then I'm out of ideas (ComputerA and computerB are running same version
of hbase? What are the versions of hbase and hadoop?).
St.Ack
Re: How to access data from HBase on Tomcat ?
Posted by ma qiang <ma...@gmail.com>.
Yes, I can.
On Wed, Jun 4, 2008 at 12:17 AM, stack <st...@duboce.net> wrote:
> On computer A, can you telnet to port 60000 on computer B?
>
> E.g.
>
>> telnet 192.168.1.8 60000
>
> What do you see?
>
> Does it do something like this?
>
> Trying 192.168.1.8..
> Connected to 192.168.1.8
> Escape character is '^]'.
>
>
> ... and just hang there?
>
> St.Ack
>
>
>
> ma qiang wrote:
>>
>> Yes,it is.
>>
>>
>> On Wed, Jun 4, 2008 at 12:08 AM, Jean-Daniel Cryans <jd...@gmail.com>
>> wrote:
>>
>>>
>>> Ok so you should have some "INFO ipc.Client: Retrying connect to server:
>>> 192.168.1.8:60000" in your console. Do you?
>>>
>>> Jean-Daniel
>>>
>>> 2008/6/3 ma qiang <ma...@gmail.com>:
>>>
>>>
>>>>
>>>> Besides , It's only a java app and haven't deployed in Tomcat .
>>>>
>>>>
>>>>
>>>> On Wed, Jun 4, 2008 at 12:03 AM, ma qiang <ma...@gmail.com> wrote:
>>>>
>>>>>
>>>>> I only wrote a java class in computer A which read data form remote
>>>>>
>>>>
>>>> hbase,
>>>>
>>>>>
>>>>> the code as below;
>>>>>
>>>>> HBaseConfiguration conf=new HBaseConfiguration();
>>>>> conf.set("hbase.master", "192.168.1.8 : 60000"); //computer B's IP
>>>>>
>>>>
>>>> and port
>>>>
>>>>>
>>>>> HTable hTable=new HTable(conf, new Text(table name));
>>>>>
>>>>> I only used java, and I think It's a simplest java program , not to
>>>>> metion other java programs more complex.
>>>>>
>>>>>
>>>>>
>>>>> On Tue, Jun 3, 2008 at 10:14 PM, stack <st...@duboce.net> wrote:
>>>>>
>>>>>>
>>>>>> Can you connect from computer A to computer B with any program?
>>>>>> St.Ack
>>>>>>
>>>>>>
>
>
Re: How to access data from HBase on Tomcat ?
Posted by stack <st...@duboce.net>.
On computer A, can you telnet to port 60000 on computer B?
E.g.
> telnet 192.168.1.8 60000
What do you see?
Does it do something like this?
Trying 192.168.1.8..
Connected to 192.168.1.8
Escape character is '^]'.
... and just hang there?
St.Ack
ma qiang wrote:
> Yes,it is.
>
>
> On Wed, Jun 4, 2008 at 12:08 AM, Jean-Daniel Cryans <jd...@gmail.com> wrote:
>
>> Ok so you should have some "INFO ipc.Client: Retrying connect to server:
>> 192.168.1.8:60000" in your console. Do you?
>>
>> Jean-Daniel
>>
>> 2008/6/3 ma qiang <ma...@gmail.com>:
>>
>>
>>> Besides , It's only a java app and haven't deployed in Tomcat .
>>>
>>>
>>>
>>> On Wed, Jun 4, 2008 at 12:03 AM, ma qiang <ma...@gmail.com> wrote:
>>>
>>>> I only wrote a java class in computer A which read data form remote
>>>>
>>> hbase,
>>>
>>>> the code as below;
>>>>
>>>> HBaseConfiguration conf=new HBaseConfiguration();
>>>> conf.set("hbase.master", "192.168.1.8 : 60000"); //computer B's IP
>>>>
>>> and port
>>>
>>>> HTable hTable=new HTable(conf, new Text(table name));
>>>>
>>>> I only used java, and I think It's a simplest java program , not to
>>>> metion other java programs more complex.
>>>>
>>>>
>>>>
>>>> On Tue, Jun 3, 2008 at 10:14 PM, stack <st...@duboce.net> wrote:
>>>>
>>>>> Can you connect from computer A to computer B with any program?
>>>>> St.Ack
>>>>>
>>>>>
Re: How to access data from HBase on Tomcat ?
Posted by ma qiang <ma...@gmail.com>.
Yes,it is.
On Wed, Jun 4, 2008 at 12:08 AM, Jean-Daniel Cryans <jd...@gmail.com> wrote:
> Ok so you should have some "INFO ipc.Client: Retrying connect to server:
> 192.168.1.8:60000" in your console. Do you?
>
> Jean-Daniel
>
> 2008/6/3 ma qiang <ma...@gmail.com>:
>
>> Besides , It's only a java app and haven't deployed in Tomcat .
>>
>>
>>
>> On Wed, Jun 4, 2008 at 12:03 AM, ma qiang <ma...@gmail.com> wrote:
>> > I only wrote a java class in computer A which read data form remote
>> hbase,
>> >
>> > the code as below;
>> >
>> > HBaseConfiguration conf=new HBaseConfiguration();
>> > conf.set("hbase.master", "192.168.1.8 : 60000"); //computer B's IP
>> and port
>> > HTable hTable=new HTable(conf, new Text(table name));
>> >
>> > I only used java, and I think It's a simplest java program , not to
>> > metion other java programs more complex.
>> >
>> >
>> >
>> > On Tue, Jun 3, 2008 at 10:14 PM, stack <st...@duboce.net> wrote:
>> >> Can you connect from computer A to computer B with any program?
>> >> St.Ack
>> >>
>> >
>>
>
Re: How to access data from HBase on Tomcat ?
Posted by Jean-Daniel Cryans <jd...@gmail.com>.
Ok so you should have some "INFO ipc.Client: Retrying connect to server:
192.168.1.8:60000" in your console. Do you?
Jean-Daniel
2008/6/3 ma qiang <ma...@gmail.com>:
> Besides , It's only a java app and haven't deployed in Tomcat .
>
>
>
> On Wed, Jun 4, 2008 at 12:03 AM, ma qiang <ma...@gmail.com> wrote:
> > I only wrote a java class in computer A which read data form remote
> hbase,
> >
> > the code as below;
> >
> > HBaseConfiguration conf=new HBaseConfiguration();
> > conf.set("hbase.master", "192.168.1.8 : 60000"); //computer B's IP
> and port
> > HTable hTable=new HTable(conf, new Text(table name));
> >
> > I only used java, and I think It's a simplest java program , not to
> > metion other java programs more complex.
> >
> >
> >
> > On Tue, Jun 3, 2008 at 10:14 PM, stack <st...@duboce.net> wrote:
> >> Can you connect from computer A to computer B with any program?
> >> St.Ack
> >>
> >
>
Re: How to access data from HBase on Tomcat ?
Posted by ma qiang <ma...@gmail.com>.
Besides , It's only a java app and haven't deployed in Tomcat .
On Wed, Jun 4, 2008 at 12:03 AM, ma qiang <ma...@gmail.com> wrote:
> I only wrote a java class in computer A which read data form remote hbase,
>
> the code as below;
>
> HBaseConfiguration conf=new HBaseConfiguration();
> conf.set("hbase.master", "192.168.1.8 : 60000"); //computer B's IP and port
> HTable hTable=new HTable(conf, new Text(table name));
>
> I only used java, and I think It's a simplest java program , not to
> metion other java programs more complex.
>
>
>
> On Tue, Jun 3, 2008 at 10:14 PM, stack <st...@duboce.net> wrote:
>> Can you connect from computer A to computer B with any program?
>> St.Ack
>>
>
Re: How to access data from HBase on Tomcat ?
Posted by ma qiang <ma...@gmail.com>.
I only wrote a java class in computer A which read data form remote hbase,
the code as below;
HBaseConfiguration conf=new HBaseConfiguration();
conf.set("hbase.master", "192.168.1.8 : 60000"); //computer B's IP and port
HTable hTable=new HTable(conf, new Text(table name));
I only used java, and I think It's a simplest java program , not to
metion other java programs more complex.
On Tue, Jun 3, 2008 at 10:14 PM, stack <st...@duboce.net> wrote:
> Can you connect from computer A to computer B with any program?
> St.Ack
>
Re: How to access data from HBase on Tomcat ?
Posted by stack <st...@duboce.net>.
Can you connect from computer A to computer B with any program?
St.Ack
Re: How to access data from HBase on Tomcat ?
Posted by Jean-Daniel Cryans <jd...@gmail.com>.
Can you show us computer's B tomcat log where it is trying to connect to
computer A? There should be a bunch of "Trying to connect to IPADDRES:PORT"
thanks
Jean-Daniel
2008/6/3 ma qiang <ma...@gmail.com>:
> I can run an hbase shell on computer A , but I cannot connect to
> computer B using java program.
> I have tried several methods, including conf.set("hbase.master","
> 192.168.1.1");
> but failed. :)
>
> On Wed, May 28, 2008 at 12:53 AM, stack <st...@duboce.net> wrote:
> > $HBASE_HOME/bin/shell --master:COMPUTERB_IP:60000
> >
> > St.Ack
> >
> >
> > ma qiang wrote:
> >>
> >> Sorry. How to connect to computer B using hbase shell on computer A?
> >> Thanks !
> >>
> >>
> >>
> >> On Tue, May 27, 2008 at 4:01 AM, stack <st...@duboce.net> wrote:
> >>
> >>>
> >>> Can you run an hbase shell on computer A and connect to computer B?
> Does
> >>> it
> >>> work? Perhaps you networking is wonky on computer A? When you specify
> >>> hbase.master, you do it as follows:
> >>>
> >>> conf.set("hbase.master", "192.168.1.1:60000");
> >>>
> >>> ... with no spaces around the IP as you have in your sample below?
> >>>
> >>> St.Ack
> >>>
> >>>
> >>> ma qiang wrote:
> >>>
> >>>>
> >>>> I just wrote a simplest java class which read data form remote hbase,
> >>>> the code as below;
> >>>>
> >>>>
> >>>> HBaseConfiguration conf=new HBaseConfiguration();
> >>>> conf.set("hbase.master", "remote computer ip : 60000");
> >>>> HTable hTable=new HTable(conf, new Text(table name));
> >>>>
> >>>> finally system print as follow:
> >>>> 08/05/26 10:03:41 INFO ipc.Client: Retrying connect to server:
> >>>> /127.0.1.1:60020. Already tried 1 time(s).
> >>>> 08/05/26 10:04:03 INFO ipc.Client: Retrying connect to server:
> >>>> /127.0.1.1:60020. Already tried 2 time(s).
> >>>> 08/05/26 10:04:25 INFO ipc.Client: Retrying connect to server:
> >>>> /127.0.1.1:60020. Already tried 3 time(s).
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> On Mon, May 26, 2008 at 2:55 AM, stack <st...@duboce.net> wrote:
> >>>>
> >>>>
> >>>>>
> >>>>> I'd guess computer A is not finding your customizations of
> hbase.master
> >>>>> in
> >>>>> your hbase-site.xml and instead its picking up the default setting
> for
> >>>>> hbase.master (localhost). You could try manually setting computerB
> as
> >>>>> hbase.master on the HBaseConfiguration you create to pass
> >>>>> HTable/HBaseAdmin
> >>>>> in your webapp context to verify this is indeed the case.
> >>>>>
> >>>>> Where is your hbase-site.xml currently? Is it bundled into your
> >>>>> webapp?
> >>>>> If
> >>>>> so, at what location?
> >>>>>
> >>>>> St.Ack
> >>>>>
> >>>>> ma qiang wrote:
> >>>>>
> >>>>>
> >>>>>>
> >>>>>> Hi,
> >>>>>> Thank you for your reply so much!
> >>>>>> I meet this problem. My program which read data from hbase run on
> >>>>>> computer A, and the hbase deployed on computer B.
> >>>>>> whatever I set the path in the HBaseConfiguration object in my
> >>>>>> program, the program always read data from local computer A not to
> >>>>>> read data from computer B. Can you tell me why and how to resolve
> this
> >>>>>> problem ?
> >>>>>> Thank you !
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> On Sat, May 24, 2008 at 9:27 AM, Jean-Daniel Cryans
> >>>>>> <jd...@gmail.com>
> >>>>>> wrote:
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>>
> >>>>>>> Hi maqiang,
> >>>>>>>
> >>>>>>> When you're running your webapp, using client's classes like HTable
> >>>>>>> will
> >>>>>>> require you to have a HBaseConfiguration object. When instantiated,
> >>>>>>> it
> >>>>>>> expects you to have hbase-site.xml in your path and then reads from
> >>>>>>> it
> >>>>>>> to
> >>>>>>> obtain the master's adress and thus you can get your data.
> >>>>>>>
> >>>>>>> Jean-Daniel
> >>>>>>>
> >>>>>>> 2008/5/23 ma qiang <ma...@gmail.com>:
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>>
> >>>>>>>> Hi all,
> >>>>>>>> In my web app based on Tomcat, the server read data from HBase
> >>>>>>>> then return these to client as a response. , Who can tell me how?
> >>>>>>>> Thank you very much!
> >>>>>>>>
> >>>>>>>> Best wishes !
> >>>>>>>> maqiang
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>
> >>>>>
> >>>
> >>>
> >
> >
>
Re: How to access data from HBase on Tomcat ?
Posted by ma qiang <ma...@gmail.com>.
I can run an hbase shell on computer A , but I cannot connect to
computer B using java program.
I have tried several methods, including conf.set("hbase.master","192.168.1.1");
but failed. :)
On Wed, May 28, 2008 at 12:53 AM, stack <st...@duboce.net> wrote:
> $HBASE_HOME/bin/shell --master:COMPUTERB_IP:60000
>
> St.Ack
>
>
> ma qiang wrote:
>>
>> Sorry. How to connect to computer B using hbase shell on computer A?
>> Thanks !
>>
>>
>>
>> On Tue, May 27, 2008 at 4:01 AM, stack <st...@duboce.net> wrote:
>>
>>>
>>> Can you run an hbase shell on computer A and connect to computer B? Does
>>> it
>>> work? Perhaps you networking is wonky on computer A? When you specify
>>> hbase.master, you do it as follows:
>>>
>>> conf.set("hbase.master", "192.168.1.1:60000");
>>>
>>> ... with no spaces around the IP as you have in your sample below?
>>>
>>> St.Ack
>>>
>>>
>>> ma qiang wrote:
>>>
>>>>
>>>> I just wrote a simplest java class which read data form remote hbase,
>>>> the code as below;
>>>>
>>>>
>>>> HBaseConfiguration conf=new HBaseConfiguration();
>>>> conf.set("hbase.master", "remote computer ip : 60000");
>>>> HTable hTable=new HTable(conf, new Text(table name));
>>>>
>>>> finally system print as follow:
>>>> 08/05/26 10:03:41 INFO ipc.Client: Retrying connect to server:
>>>> /127.0.1.1:60020. Already tried 1 time(s).
>>>> 08/05/26 10:04:03 INFO ipc.Client: Retrying connect to server:
>>>> /127.0.1.1:60020. Already tried 2 time(s).
>>>> 08/05/26 10:04:25 INFO ipc.Client: Retrying connect to server:
>>>> /127.0.1.1:60020. Already tried 3 time(s).
>>>>
>>>>
>>>>
>>>>
>>>> On Mon, May 26, 2008 at 2:55 AM, stack <st...@duboce.net> wrote:
>>>>
>>>>
>>>>>
>>>>> I'd guess computer A is not finding your customizations of hbase.master
>>>>> in
>>>>> your hbase-site.xml and instead its picking up the default setting for
>>>>> hbase.master (localhost). You could try manually setting computerB as
>>>>> hbase.master on the HBaseConfiguration you create to pass
>>>>> HTable/HBaseAdmin
>>>>> in your webapp context to verify this is indeed the case.
>>>>>
>>>>> Where is your hbase-site.xml currently? Is it bundled into your
>>>>> webapp?
>>>>> If
>>>>> so, at what location?
>>>>>
>>>>> St.Ack
>>>>>
>>>>> ma qiang wrote:
>>>>>
>>>>>
>>>>>>
>>>>>> Hi,
>>>>>> Thank you for your reply so much!
>>>>>> I meet this problem. My program which read data from hbase run on
>>>>>> computer A, and the hbase deployed on computer B.
>>>>>> whatever I set the path in the HBaseConfiguration object in my
>>>>>> program, the program always read data from local computer A not to
>>>>>> read data from computer B. Can you tell me why and how to resolve this
>>>>>> problem ?
>>>>>> Thank you !
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Sat, May 24, 2008 at 9:27 AM, Jean-Daniel Cryans
>>>>>> <jd...@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> Hi maqiang,
>>>>>>>
>>>>>>> When you're running your webapp, using client's classes like HTable
>>>>>>> will
>>>>>>> require you to have a HBaseConfiguration object. When instantiated,
>>>>>>> it
>>>>>>> expects you to have hbase-site.xml in your path and then reads from
>>>>>>> it
>>>>>>> to
>>>>>>> obtain the master's adress and thus you can get your data.
>>>>>>>
>>>>>>> Jean-Daniel
>>>>>>>
>>>>>>> 2008/5/23 ma qiang <ma...@gmail.com>:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> Hi all,
>>>>>>>> In my web app based on Tomcat, the server read data from HBase
>>>>>>>> then return these to client as a response. , Who can tell me how?
>>>>>>>> Thank you very much!
>>>>>>>>
>>>>>>>> Best wishes !
>>>>>>>> maqiang
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>
Re: How to access data from HBase on Tomcat ?
Posted by stack <st...@duboce.net>.
$HBASE_HOME/bin/shell --master:COMPUTERB_IP:60000
St.Ack
ma qiang wrote:
> Sorry. How to connect to computer B using hbase shell on computer A?
> Thanks !
>
>
>
> On Tue, May 27, 2008 at 4:01 AM, stack <st...@duboce.net> wrote:
>
>> Can you run an hbase shell on computer A and connect to computer B? Does it
>> work? Perhaps you networking is wonky on computer A? When you specify
>> hbase.master, you do it as follows:
>>
>> conf.set("hbase.master", "192.168.1.1:60000");
>>
>> ... with no spaces around the IP as you have in your sample below?
>>
>> St.Ack
>>
>>
>> ma qiang wrote:
>>
>>> I just wrote a simplest java class which read data form remote hbase,
>>> the code as below;
>>>
>>>
>>> HBaseConfiguration conf=new HBaseConfiguration();
>>> conf.set("hbase.master", "remote computer ip : 60000");
>>> HTable hTable=new HTable(conf, new Text(table name));
>>>
>>> finally system print as follow:
>>> 08/05/26 10:03:41 INFO ipc.Client: Retrying connect to server:
>>> /127.0.1.1:60020. Already tried 1 time(s).
>>> 08/05/26 10:04:03 INFO ipc.Client: Retrying connect to server:
>>> /127.0.1.1:60020. Already tried 2 time(s).
>>> 08/05/26 10:04:25 INFO ipc.Client: Retrying connect to server:
>>> /127.0.1.1:60020. Already tried 3 time(s).
>>>
>>>
>>>
>>>
>>> On Mon, May 26, 2008 at 2:55 AM, stack <st...@duboce.net> wrote:
>>>
>>>
>>>> I'd guess computer A is not finding your customizations of hbase.master
>>>> in
>>>> your hbase-site.xml and instead its picking up the default setting for
>>>> hbase.master (localhost). You could try manually setting computerB as
>>>> hbase.master on the HBaseConfiguration you create to pass
>>>> HTable/HBaseAdmin
>>>> in your webapp context to verify this is indeed the case.
>>>>
>>>> Where is your hbase-site.xml currently? Is it bundled into your webapp?
>>>> If
>>>> so, at what location?
>>>>
>>>> St.Ack
>>>>
>>>> ma qiang wrote:
>>>>
>>>>
>>>>> Hi,
>>>>> Thank you for your reply so much!
>>>>> I meet this problem. My program which read data from hbase run on
>>>>> computer A, and the hbase deployed on computer B.
>>>>> whatever I set the path in the HBaseConfiguration object in my
>>>>> program, the program always read data from local computer A not to
>>>>> read data from computer B. Can you tell me why and how to resolve this
>>>>> problem ?
>>>>> Thank you !
>>>>>
>>>>>
>>>>>
>>>>> On Sat, May 24, 2008 at 9:27 AM, Jean-Daniel Cryans <jd...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>
>>>>>
>>>>>> Hi maqiang,
>>>>>>
>>>>>> When you're running your webapp, using client's classes like HTable
>>>>>> will
>>>>>> require you to have a HBaseConfiguration object. When instantiated, it
>>>>>> expects you to have hbase-site.xml in your path and then reads from it
>>>>>> to
>>>>>> obtain the master's adress and thus you can get your data.
>>>>>>
>>>>>> Jean-Daniel
>>>>>>
>>>>>> 2008/5/23 ma qiang <ma...@gmail.com>:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Hi all,
>>>>>>> In my web app based on Tomcat, the server read data from HBase
>>>>>>> then return these to client as a response. , Who can tell me how?
>>>>>>> Thank you very much!
>>>>>>>
>>>>>>> Best wishes !
>>>>>>> maqiang
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>
>>
Re: How to access data from HBase on Tomcat ?
Posted by ma qiang <ma...@gmail.com>.
Sorry. How to connect to computer B using hbase shell on computer A?
Thanks !
On Tue, May 27, 2008 at 4:01 AM, stack <st...@duboce.net> wrote:
> Can you run an hbase shell on computer A and connect to computer B? Does it
> work? Perhaps you networking is wonky on computer A? When you specify
> hbase.master, you do it as follows:
>
> conf.set("hbase.master", "192.168.1.1:60000");
>
> ... with no spaces around the IP as you have in your sample below?
>
> St.Ack
>
>
> ma qiang wrote:
>>
>> I just wrote a simplest java class which read data form remote hbase,
>> the code as below;
>>
>>
>> HBaseConfiguration conf=new HBaseConfiguration();
>> conf.set("hbase.master", "remote computer ip : 60000");
>> HTable hTable=new HTable(conf, new Text(table name));
>>
>> finally system print as follow:
>> 08/05/26 10:03:41 INFO ipc.Client: Retrying connect to server:
>> /127.0.1.1:60020. Already tried 1 time(s).
>> 08/05/26 10:04:03 INFO ipc.Client: Retrying connect to server:
>> /127.0.1.1:60020. Already tried 2 time(s).
>> 08/05/26 10:04:25 INFO ipc.Client: Retrying connect to server:
>> /127.0.1.1:60020. Already tried 3 time(s).
>>
>>
>>
>>
>> On Mon, May 26, 2008 at 2:55 AM, stack <st...@duboce.net> wrote:
>>
>>>
>>> I'd guess computer A is not finding your customizations of hbase.master
>>> in
>>> your hbase-site.xml and instead its picking up the default setting for
>>> hbase.master (localhost). You could try manually setting computerB as
>>> hbase.master on the HBaseConfiguration you create to pass
>>> HTable/HBaseAdmin
>>> in your webapp context to verify this is indeed the case.
>>>
>>> Where is your hbase-site.xml currently? Is it bundled into your webapp?
>>> If
>>> so, at what location?
>>>
>>> St.Ack
>>>
>>> ma qiang wrote:
>>>
>>>>
>>>> Hi,
>>>> Thank you for your reply so much!
>>>> I meet this problem. My program which read data from hbase run on
>>>> computer A, and the hbase deployed on computer B.
>>>> whatever I set the path in the HBaseConfiguration object in my
>>>> program, the program always read data from local computer A not to
>>>> read data from computer B. Can you tell me why and how to resolve this
>>>> problem ?
>>>> Thank you !
>>>>
>>>>
>>>>
>>>> On Sat, May 24, 2008 at 9:27 AM, Jean-Daniel Cryans <jd...@gmail.com>
>>>> wrote:
>>>>
>>>>
>>>>>
>>>>> Hi maqiang,
>>>>>
>>>>> When you're running your webapp, using client's classes like HTable
>>>>> will
>>>>> require you to have a HBaseConfiguration object. When instantiated, it
>>>>> expects you to have hbase-site.xml in your path and then reads from it
>>>>> to
>>>>> obtain the master's adress and thus you can get your data.
>>>>>
>>>>> Jean-Daniel
>>>>>
>>>>> 2008/5/23 ma qiang <ma...@gmail.com>:
>>>>>
>>>>>
>>>>>
>>>>>>
>>>>>> Hi all,
>>>>>> In my web app based on Tomcat, the server read data from HBase
>>>>>> then return these to client as a response. , Who can tell me how?
>>>>>> Thank you very much!
>>>>>>
>>>>>> Best wishes !
>>>>>> maqiang
>>>>>>
>>>>>>
>>>>>>
>>>
>>>
>
>
Re: How to access data from HBase on Tomcat ?
Posted by stack <st...@duboce.net>.
Can you run an hbase shell on computer A and connect to computer B?
Does it work? Perhaps you networking is wonky on computer A? When you
specify hbase.master, you do it as follows:
conf.set("hbase.master", "192.168.1.1:60000");
... with no spaces around the IP as you have in your sample below?
St.Ack
ma qiang wrote:
> I just wrote a simplest java class which read data form remote hbase,
> the code as below;
>
>
> HBaseConfiguration conf=new HBaseConfiguration();
> conf.set("hbase.master", "remote computer ip : 60000");
> HTable hTable=new HTable(conf, new Text(table name));
>
> finally system print as follow:
> 08/05/26 10:03:41 INFO ipc.Client: Retrying connect to server:
> /127.0.1.1:60020. Already tried 1 time(s).
> 08/05/26 10:04:03 INFO ipc.Client: Retrying connect to server:
> /127.0.1.1:60020. Already tried 2 time(s).
> 08/05/26 10:04:25 INFO ipc.Client: Retrying connect to server:
> /127.0.1.1:60020. Already tried 3 time(s).
>
>
>
>
> On Mon, May 26, 2008 at 2:55 AM, stack <st...@duboce.net> wrote:
>
>> I'd guess computer A is not finding your customizations of hbase.master in
>> your hbase-site.xml and instead its picking up the default setting for
>> hbase.master (localhost). You could try manually setting computerB as
>> hbase.master on the HBaseConfiguration you create to pass HTable/HBaseAdmin
>> in your webapp context to verify this is indeed the case.
>>
>> Where is your hbase-site.xml currently? Is it bundled into your webapp? If
>> so, at what location?
>>
>> St.Ack
>>
>> ma qiang wrote:
>>
>>> Hi,
>>> Thank you for your reply so much!
>>> I meet this problem. My program which read data from hbase run on
>>> computer A, and the hbase deployed on computer B.
>>> whatever I set the path in the HBaseConfiguration object in my
>>> program, the program always read data from local computer A not to
>>> read data from computer B. Can you tell me why and how to resolve this
>>> problem ?
>>> Thank you !
>>>
>>>
>>>
>>> On Sat, May 24, 2008 at 9:27 AM, Jean-Daniel Cryans <jd...@gmail.com>
>>> wrote:
>>>
>>>
>>>> Hi maqiang,
>>>>
>>>> When you're running your webapp, using client's classes like HTable will
>>>> require you to have a HBaseConfiguration object. When instantiated, it
>>>> expects you to have hbase-site.xml in your path and then reads from it to
>>>> obtain the master's adress and thus you can get your data.
>>>>
>>>> Jean-Daniel
>>>>
>>>> 2008/5/23 ma qiang <ma...@gmail.com>:
>>>>
>>>>
>>>>
>>>>> Hi all,
>>>>> In my web app based on Tomcat, the server read data from HBase
>>>>> then return these to client as a response. , Who can tell me how?
>>>>> Thank you very much!
>>>>>
>>>>> Best wishes !
>>>>> maqiang
>>>>>
>>>>>
>>>>>
>>
Re: How to access data from HBase on Tomcat ?
Posted by ma qiang <ma...@gmail.com>.
I just wrote a simplest java class which read data form remote hbase,
the code as below;
HBaseConfiguration conf=new HBaseConfiguration();
conf.set("hbase.master", "remote computer ip : 60000");
HTable hTable=new HTable(conf, new Text(table name));
finally system print as follow:
08/05/26 10:03:41 INFO ipc.Client: Retrying connect to server:
/127.0.1.1:60020. Already tried 1 time(s).
08/05/26 10:04:03 INFO ipc.Client: Retrying connect to server:
/127.0.1.1:60020. Already tried 2 time(s).
08/05/26 10:04:25 INFO ipc.Client: Retrying connect to server:
/127.0.1.1:60020. Already tried 3 time(s).
On Mon, May 26, 2008 at 2:55 AM, stack <st...@duboce.net> wrote:
> I'd guess computer A is not finding your customizations of hbase.master in
> your hbase-site.xml and instead its picking up the default setting for
> hbase.master (localhost). You could try manually setting computerB as
> hbase.master on the HBaseConfiguration you create to pass HTable/HBaseAdmin
> in your webapp context to verify this is indeed the case.
>
> Where is your hbase-site.xml currently? Is it bundled into your webapp? If
> so, at what location?
>
> St.Ack
>
> ma qiang wrote:
>>
>> Hi,
>> Thank you for your reply so much!
>> I meet this problem. My program which read data from hbase run on
>> computer A, and the hbase deployed on computer B.
>> whatever I set the path in the HBaseConfiguration object in my
>> program, the program always read data from local computer A not to
>> read data from computer B. Can you tell me why and how to resolve this
>> problem ?
>> Thank you !
>>
>>
>>
>> On Sat, May 24, 2008 at 9:27 AM, Jean-Daniel Cryans <jd...@gmail.com>
>> wrote:
>>
>>>
>>> Hi maqiang,
>>>
>>> When you're running your webapp, using client's classes like HTable will
>>> require you to have a HBaseConfiguration object. When instantiated, it
>>> expects you to have hbase-site.xml in your path and then reads from it to
>>> obtain the master's adress and thus you can get your data.
>>>
>>> Jean-Daniel
>>>
>>> 2008/5/23 ma qiang <ma...@gmail.com>:
>>>
>>>
>>>>
>>>> Hi all,
>>>> In my web app based on Tomcat, the server read data from HBase
>>>> then return these to client as a response. , Who can tell me how?
>>>> Thank you very much!
>>>>
>>>> Best wishes !
>>>> maqiang
>>>>
>>>>
>
>
Re: How to access data from HBase on Tomcat ?
Posted by stack <st...@duboce.net>.
I'd guess computer A is not finding your customizations of hbase.master
in your hbase-site.xml and instead its picking up the default setting
for hbase.master (localhost). You could try manually setting computerB
as hbase.master on the HBaseConfiguration you create to pass
HTable/HBaseAdmin in your webapp context to verify this is indeed the case.
Where is your hbase-site.xml currently? Is it bundled into your
webapp? If so, at what location?
St.Ack
ma qiang wrote:
> Hi,
> Thank you for your reply so much!
> I meet this problem. My program which read data from hbase run on
> computer A, and the hbase deployed on computer B.
> whatever I set the path in the HBaseConfiguration object in my
> program, the program always read data from local computer A not to
> read data from computer B. Can you tell me why and how to resolve this
> problem ?
> Thank you !
>
>
>
> On Sat, May 24, 2008 at 9:27 AM, Jean-Daniel Cryans <jd...@gmail.com> wrote:
>
>> Hi maqiang,
>>
>> When you're running your webapp, using client's classes like HTable will
>> require you to have a HBaseConfiguration object. When instantiated, it
>> expects you to have hbase-site.xml in your path and then reads from it to
>> obtain the master's adress and thus you can get your data.
>>
>> Jean-Daniel
>>
>> 2008/5/23 ma qiang <ma...@gmail.com>:
>>
>>
>>> Hi all,
>>> In my web app based on Tomcat, the server read data from HBase
>>> then return these to client as a response. , Who can tell me how?
>>> Thank you very much!
>>>
>>> Best wishes !
>>> maqiang
>>>
>>>
Re: How to access data from HBase on Tomcat ?
Posted by ma qiang <ma...@gmail.com>.
Hi,
Thank you for your reply so much!
I meet this problem. My program which read data from hbase run on
computer A, and the hbase deployed on computer B.
whatever I set the path in the HBaseConfiguration object in my
program, the program always read data from local computer A not to
read data from computer B. Can you tell me why and how to resolve this
problem ?
Thank you !
On Sat, May 24, 2008 at 9:27 AM, Jean-Daniel Cryans <jd...@gmail.com> wrote:
> Hi maqiang,
>
> When you're running your webapp, using client's classes like HTable will
> require you to have a HBaseConfiguration object. When instantiated, it
> expects you to have hbase-site.xml in your path and then reads from it to
> obtain the master's adress and thus you can get your data.
>
> Jean-Daniel
>
> 2008/5/23 ma qiang <ma...@gmail.com>:
>
>> Hi all,
>> In my web app based on Tomcat, the server read data from HBase
>> then return these to client as a response. , Who can tell me how?
>> Thank you very much!
>>
>> Best wishes !
>> maqiang
>>
>
Re: How to access data from HBase on Tomcat ?
Posted by Jean-Daniel Cryans <jd...@gmail.com>.
Hi maqiang,
When you're running your webapp, using client's classes like HTable will
require you to have a HBaseConfiguration object. When instantiated, it
expects you to have hbase-site.xml in your path and then reads from it to
obtain the master's adress and thus you can get your data.
Jean-Daniel
2008/5/23 ma qiang <ma...@gmail.com>:
> Hi all,
> In my web app based on Tomcat, the server read data from HBase
> then return these to client as a response. , Who can tell me how?
> Thank you very much!
>
> Best wishes !
> maqiang
>