hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mouradk <mourad...@googlemail.com>
Subject Re: Failure connecting to Hbase remotely from Tomcat 6 Servlet
Date Mon, 01 Oct 2012 17:22:53 GMT
Hi,

Thanks for you reply. I am trying to connect to Hbase running on a remote ec2 instance from
a web app in tomcat running in a different ec2 instance. My Hbase handler lives in a jar of
a another project  (foundation) in it's src folder. While debugging, the HBaseConfiguration
picks up the properties from that base-site.xml file. This "foundation" project is bundled
in the lib folder of the web application and referenced to it.

Initially, I added the hbase-site.xml in the lib folder of the web app (WEB-INF/lib) but it'
not being used there. I have just added the hbase-site.xml in tomcat conf folder along side
context.xml and server.xml files (this is the place?)

I restarted tomcat but this did not solve the problem. What I can't figure out is not getting
anything in the logs, I can't trace an error or exception, to put me in the right direction.
Is there something in the policy files that need to be set as well?

is running a web app with ServletContextListener needs some permissions?

Many thanks for your help,

Mouradk 

On 1 Oct 2012, at 16:06, mlanciau <mlanciau@gmail.com> wrote:

> Hello Mouradk,
> 
> I use tomcat + HBase and I have no problem. (And it's really cool !)
> I do not change any tomcat policy, just add the lib in WEB-INF/lib/ and the
> hbase-site.xml in a conf folder (in the tomcat build path).
> 
> How do you add the hbase-site.xml ?
> 
> Regards.
> 
> 2012/10/1 Mouradk <mouradk78@googlemail.com>
> 
>> Hello,
>> 
>> This is my first post so apologies if I am breaking some etiquette.
>> 
>> I am not an expert on Hbase and have been flaying through threads of Hbase
>> remote connection but with no luck solving my problem.
>> 
>> I am running a Hbase/Hadoop single cluster on an EC2 instance (Ubuntu
>> 10.4). I am also running a servlet on a tomcat6 server in another ec2
>> instance. The plan is for the servlet to write and read to the remote Hbase
>> instance. The servlet is running a context listener with some java routines
>> (ServletContextListener).
>> 
>> Now if I run the java project as a runnable jar instead of a servlet all
>> is fine. It connects to Hbase and writes/reads from table. But on tomcat6
>> it just freezes when attempting to connect to the Hbase instance.
>> 
>> 2012-10-01 11:11:40,751 [Timer-4] INFO
>> com.myApp.foundation.access.HBaseHandler  initialise(..) - Initialisation
>> HbaseHandler configuration ...
>> 2012-10-01 11:11:40,763 [Timer-4] DEBUG
>> org.apache.hadoop.conf.Configuration  <init>(..) - java.io.IOException:
>> config()
>>    at org.apache.hadoop.conf.Configuration.<init>(Configuration.java:211)
>>    at org.apache.hadoop.conf.Configuration.<init>(Configuration.java:198)
>>    at
>> org.apache.hadoop.hbase.HBaseConfiguration.<init>(HBaseConfiguration.java:33)
>>    at
>> com.myApp.foundation.access.HBaseHandler.initialise(HBaseHandler.java:507)
>>    at
>> com.myApp.foundation.access.HBaseHandler.<init>(HBaseHandler.java:53)
>>    at
>> com.myApp.foundation.access.HBaseHandler.getInstance(HBaseHandler.java:500)
>>    at com.myApp.foundation.hbase.StorableRow.<clinit>(StorableRow.java:40)
>>    at com.myApp.foundation.entities.Article.storeToHbase(Article.java:257)
>>    at
>> com.myApp.task.impl.HBaseArticlePersisterTask.process(HBaseArticlePersisterTask.java:101)
>>    at com.myApp.foundation.task.QueueTask.performTask(QueueTask.java:101)
>>    at
>> com.myApp.runner.impl.HBasePersisterRunner$1.run(HBasePersisterRunner.java:46)
>>    at java.util.TimerThread.mainLoop(Timer.java:512)
>>    at java.util.TimerThread.run(Timer.java:462)
>> 
>> 2012-10-01 11:11:40,803 [Timer-4] INFO
>> com.myApp.foundation.access.HBaseHandler  initialise(..) - Config resource
>> zookeeper.quorum: ip-10-10-10-10.eu-west-1.compute.internal
>> 
>> 2012-10-01 11:11:40,803 [Timer-4] INFO
>> com.myApp.foundation.access.HBaseHandler  initialise(..) - Config resource
>> zookeeper.clientPort: 2181
>> 
>> 2012-10-01 11:11:40,804 [Timer-4] INFO
>> com.myApp.foundation.access.HBaseHandler  initialise(..) - Config resource
>> hbase.master.info.port: 60010
>> 
>> 2012-10-01 11:11:40,804 [Timer-4] INFO
>> com.myApp.foundation.access.HBaseHandler  initialise(..) - Config resource
>> hbase.master.info.bindAddress: ip-10-10-10-10.eu-west-1.compute.internal
>> I can telnet the HBase instance. In the servlet I included the
>> hbase-site.xml. But as you can see from the log, the zookkeeper.quorum is
>> getting picked up as well as the port number. All necessary ports are open
>> on the Hbase instance.
>> 
>> Something is telling me tomcat6 policy configuration is to blame. But I
>> don't see anything in the catalina logs. Are there any other logs I am
>> missing or could guide me to the right logs? Anywhere I can track if
>> Zookeeper is receiving any requests?
>> 
>> Has someone experienced the same problem?
>> 
>> Many thanks in advance.
>> 
>> Mourad
> 
> 
> 
> 
> -- 
> Maxime LANCIAUX
> http://maximelanciauxbi.blogspot.fr/


Mime
View raw message