How to access data from HBase on Tomcat ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to access data from HBase on Tomcat ?

ma qiang
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to access data from HBase on Tomcat ?

Jean-Daniel Cryans-2
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 <[hidden email]>:

> 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
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to access data from HBase on Tomcat ?

ma qiang
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 <[hidden email]> 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 <[hidden email]>:
>
>> 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
>>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to access data from HBase on Tomcat ?

stack-3
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 <[hidden email]> 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 <[hidden email]>:
>>
>>    
>>> 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
>>>
>>>      

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to access data from HBase on Tomcat ?

ma qiang
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 <[hidden email]> 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 <[hidden email]>
>> 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 <[hidden email]>:
>>>
>>>
>>>>
>>>> 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
>>>>
>>>>
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to access data from HBase on Tomcat ?

stack-3
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 <[hidden email]> 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 <[hidden email]>
>>> 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 <[hidden email]>:
>>>>
>>>>
>>>>        
>>>>> 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
>>>>>
>>>>>
>>>>>          
>>    

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to access data from HBase on Tomcat ?

ma qiang
Sorry. How to connect to computer B using hbase shell on computer A?
Thanks !



On Tue, May 27, 2008 at 4:01 AM, stack <[hidden email]> 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 <[hidden email]> 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 <[hidden email]>
>>>> 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 <[hidden email]>:
>>>>>
>>>>>
>>>>>
>>>>>>
>>>>>> 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
>>>>>>
>>>>>>
>>>>>>
>>>
>>>
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to access data from HBase on Tomcat ?

stack-3
$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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]>
>>>>> 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 <[hidden email]>:
>>>>>>
>>>>>>
>>>>>>
>>>>>>            
>>>>>>> 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
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>              
>>>>        
>>    

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to access data from HBase on Tomcat ?

ma qiang
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
>>>>>> <[hidden email]>
>>>>>> 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 <[hidden email]>:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> 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
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to access data from HBase on Tomcat ?

Jean-Daniel Cryans-2
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 <[hidden email]>:

> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
> >>>>>> <[hidden email]>
> >>>>>> 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 <[hidden email]>:
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>>
> >>>>>>>> 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
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>
> >>>>>
> >>>
> >>>
> >
> >
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to access data from HBase on Tomcat ?

stack-3
In reply to this post by ma qiang
Can you connect from computer A to computer B with any program?
St.Ack
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to access data from HBase on Tomcat ?

ma qiang
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 <[hidden email]> wrote:
> Can you connect from computer A to computer B with any program?
> St.Ack
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to access data from HBase on Tomcat ?

ma qiang
Besides , It's only a java app and haven't deployed in Tomcat .



On Wed, Jun 4, 2008 at 12:03 AM, ma qiang <[hidden email]> 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 <[hidden email]> wrote:
>> Can you connect from computer A to computer B with any program?
>> St.Ack
>>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to access data from HBase on Tomcat ?

Jean-Daniel Cryans-2
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 <[hidden email]>:

> Besides , It's only a java app and haven't deployed in Tomcat .
>
>
>
> On Wed, Jun 4, 2008 at 12:03 AM, ma qiang <[hidden email]> 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 <[hidden email]> wrote:
> >> Can you connect from computer A to computer B with any program?
> >> St.Ack
> >>
> >
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to access data from HBase on Tomcat ?

ma qiang
Yes,it is.


On Wed, Jun 4, 2008 at 12:08 AM, Jean-Daniel Cryans <[hidden email]> 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 <[hidden email]>:
>
>> Besides , It's only a java app and haven't deployed in Tomcat .
>>
>>
>>
>> On Wed, Jun 4, 2008 at 12:03 AM, ma qiang <[hidden email]> 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 <[hidden email]> wrote:
>> >> Can you connect from computer A to computer B with any program?
>> >> St.Ack
>> >>
>> >
>>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to access data from HBase on Tomcat ?

stack-3
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 <[hidden email]> 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 <[hidden email]>:
>>
>>    
>>> Besides , It's only a java app and haven't deployed in Tomcat .
>>>
>>>
>>>
>>> On Wed, Jun 4, 2008 at 12:03 AM, ma qiang <[hidden email]> 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 <[hidden email]> wrote:
>>>>        
>>>>> Can you connect from computer A to computer B with any program?
>>>>> St.Ack
>>>>>
>>>>>          

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to access data from HBase on Tomcat ?

ma qiang
Yes, I can.

On Wed, Jun 4, 2008 at 12:17 AM, stack <[hidden email]> 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 <[hidden email]>
>> 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 <[hidden email]>:
>>>
>>>
>>>>
>>>> Besides , It's only a java app and haven't deployed in Tomcat .
>>>>
>>>>
>>>>
>>>> On Wed, Jun 4, 2008 at 12:03 AM, ma qiang <[hidden email]> 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 <[hidden email]> wrote:
>>>>>
>>>>>>
>>>>>> Can you connect from computer A to computer B with any program?
>>>>>> St.Ack
>>>>>>
>>>>>>
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to access data from HBase on Tomcat ?

stack-3
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
Loading...