hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From George Stathis <gstat...@gmail.com>
Subject Re: Connecting from Tomcat to remote HBase
Date Fri, 26 Mar 2010 17:27:45 GMT
Also, I believe that hbase-site.xml should be in WEB-INF/classes instead
of WEB-INF/lib. Only JAR files are loaded from the latter.

-GS

On Fri, Mar 26, 2010 at 1:19 PM, George Stathis <gstathis@gmail.com> wrote:

> I did not include hbase-default.xml, just hbase-site.xml but your needs may
> vary. The basic thing that I needed to configure in there was the remote
> addresses of the  zookeeper nodes and their ports:
>
> [...]
>   <property>
>     <name>hbase.zookeeper.quorum</name>
>     <value>localhost</value>
>     <description>Comma separated list of servers in the ZooKeeper Quorum.
>     For example, "host1.mydomain.com,host2.mydomain.com,host3.mydomain.com
> ".
>      By default this is set to localhost for local and pseudo-distributed
> modes
>     of operation. For a fully-distributed setup, this should be set to a
> full
>     list of ZooKeeper quorum servers. If HBASE_MANAGES_ZK is set in
> hbase-env.sh
>     this is the list of servers which we will start/stop ZooKeeper on.
>     </description>
>   </property>
> [...]
>   <property>
>     <name>hbase.zookeeper.property.clientPort</name>
>     <value>2181</value>
>     <description>Property from ZooKeeper's config zoo.cfg.
>     The port at which the clients will connect.
>     </description>
>   </property>
> [...]
>
> I replaced the localhost part with a comma separated list of the quorum
> host names. Make sure of course that port 2181 is open and listening on all
> remote zookeeper nodes and that they are configured to bind on their public
> interfaces and not on some internal NAT interface like with EC2 (see this
> thread for more details:
> http://mail-archives.apache.org/mod_mbox/hadoop-hbase-user/201003.mbox/%3c96c64fa81003190800u736ad06o9c5c690880eedb7f@mail.gmail.com%3e).
>
> Warning: if you are trying to remotely connect to an EC2 cluster with the
> Java client, make sure to read the above thread to get familiar with the
> pitfalls. Use Thrift instead.
>
> -GS
>
> On Fri, Mar 26, 2010 at 12:54 PM, A Levine <levine.a@gmail.com> wrote:
>
>> Just to confirm, in the running webapp, the WEB-INF/lib/ directory
>> needs to contain:
>>
>> hbase-0.20.3.jar
>> zookeeper-3.2.2.jar
>> hadoop-0.20.2.jar
>> hbase-default.xml
>> hbase-site.xml
>>
>> Having the files in the WEB-INF/lib/ directory will enable connections
>> out to a remote HBase.  Is this correct?  Or is there more needed?
>>
>> andrew
>>
>> --
>>
>> On Fri, Mar 26, 2010 at 11:01 AM, George Stathis <gstathis@gmail.com>
>> wrote:
>> > You will need the hadoop-core jar in the classpath. HBaseConfiguration
>> > extends Configuration which is in the hadoop source. You will also need
>> the
>> > Zookeeper jar that's included in the HBase distro. I have a Maven
>> project
>> > and I had to manually add the jars to my local repository. The tree Jars
>> > that I needed to add for everything to work were:
>> >
>> > [...]
>> > [INFO] |  +- org.apache.hadoop:hbase:jar:0.20.3:compile
>> > [INFO] |  +- org.apache.hadoop:hadoop-core:jar:0.20.2:compile
>> > [INFO] |  +- org.apache.hadoop:zookeeper:jar:3.2.2:compile
>> > [...]
>> >
>> > Hope this helps.
>> >
>> > -GS
>> >
>> > On Fri, Mar 26, 2010 at 10:42 AM, A Levine <levine.a@gmail.com> wrote:
>> >
>> >> Yes:
>> >>
>> >> $> ls -1 WEB-INF/lib/
>> >> geoapi-2.3-M1.jar
>> >> gt-metadata-2.6.0.jar
>> >> gt-referencing-2.6.0.jar
>> >> hbase-0.20.3.jar
>> >> hbase-default.xml
>> >> hbase-site.xml
>> >>
>> >> andrew
>> >>
>> >> --
>> >>
>> >> On Fri, Mar 26, 2010 at 10:27 AM, Guilherme Germoglio
>> >> <germoglio@gmail.com> wrote:
>> >> > Are the hbase jars in your webapp's libs directory? You might need
>> them.
>> >> >
>> >> > On Fri, Mar 26, 2010 at 11:21 AM, A Levine <levine.a@gmail.com>
>> wrote:
>> >> >
>> >> >> I am having the hardest time tying to connect from a running webapp
>> in
>> >> >> Tomcat 6.0 to a remote HBase instance.  Whenever the webapp comes
>> to:
>> >> >>
>> >> >> HBaseConfiguration config = new HBaseConfiguration();
>> >> >>
>> >> >> There is an error reported:
>> >> >>
>> >> >> java.lang.NoClassDefFoundError: Could not initialize class
>> >> >> org.apache.hadoop.hbase.HBaseConfiguration
>> >> >>
>> >> >> I can connect to a remote HBase from a stand alone program by
>> setting
>> >> >> the classpath to /devel/hbase/conf without any issues.  However,
>> when
>> >> >> the code is used in the running webapp, the HBaseConfiguration
>> cannot
>> >> >> be initialized.  I know the hbase-default.xml and hbase-site.xml
>> need
>> >> >> to be in the CLASSPATH of the webapp so ClassLader can be called
for
>> >> >> both xml files.  Those places are:
>> >> >>
>> >> >> /WEB-INF/classes/
>> >> >> /WEB-INF/lib/*.jar
>> >> >> $CATALINA_HOME/lib
>> >> >> $CATALINA_HOME/*.jar
>> >> >>
>> >> >> I have put both files in the /WEB-INF/classes/ directory with no
>> >> >> success.  What am I doing wrong?
>> >> >>
>> >> >> andrew
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Guilherme
>> >> >
>> >> > msn: guigermoglio@hotmail.com
>> >> > homepage: http://sites.google.com/site/germoglio/
>> >> >
>> >>
>> >
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message