Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 32B39D6A1 for ; Fri, 30 Nov 2012 00:47:12 +0000 (UTC) Received: (qmail 27669 invoked by uid 500); 30 Nov 2012 00:47:09 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 27623 invoked by uid 500); 30 Nov 2012 00:47:09 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 27614 invoked by uid 99); 30 Nov 2012 00:47:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Nov 2012 00:47:09 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of svarma.ng@gmail.com designates 209.85.210.169 as permitted sender) Received: from [209.85.210.169] (HELO mail-ia0-f169.google.com) (209.85.210.169) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Nov 2012 00:47:05 +0000 Received: by mail-ia0-f169.google.com with SMTP id r4so13998472iaj.14 for ; Thu, 29 Nov 2012 16:46:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=qP7ZQWBduLOVtbB7E0c1GGNs5hS1UH4LUx0aNFtP07U=; b=l5Mqlaa3NIdHgGyVKvSzCboU412HH6nbahQfmGb85E5NDuPENDsia1XkwCSZku+p/9 x2rjHpXcCofJpLwhI2MFnYqQIeJ3nEtHmObtt1bq9TZD5102ATVxWYaBeezQ4qUZ5gxc +cEMFdUliTxqC/q3WYqRjLXvbuMzuuBaMfRiDklyhFLDm6MjtMdogkHlN3f+TA2U7eyC QReZ7Md0pmxRft/ic9X0Pvm2dk3FhzA1DlemczqwoXpaDvMDpIEnVVXAQPDv5V3u2RCq r0ow9Deo0s8OnRc4ppOQxLGGi+4TWhBMbx5T5iWneAu6EKT1jBEeXQvark6LUJ3gZGqr aMZQ== MIME-Version: 1.0 Received: by 10.50.37.133 with SMTP id y5mr24406258igj.8.1354236404826; Thu, 29 Nov 2012 16:46:44 -0800 (PST) Received: by 10.64.8.178 with HTTP; Thu, 29 Nov 2012 16:46:44 -0800 (PST) In-Reply-To: References: Date: Thu, 29 Nov 2012 16:46:44 -0800 Message-ID: Subject: Re: Configuration setup From: Suraj Varma To: user@hbase.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org The directory where hbase-site.xml is located should be in your client side classpath. Can you check if this is the case (dump your classpath right before you call to check if the directory is present). Here's the HBaseConfiguration.addHBaseResources code. http://javasourcecode.org/html/open-source/hbase/hbase-0.90.3/org/apache/hadoop/hbase/HBaseConfiguration.java.html#line.85 public static Configuration addHbaseResources(Configuration conf) { conf.addResource("hbase-default.xml"); conf.addResource("hbase-site.xml"); checkDefaultsVersion(conf); checkForClusterFreeMemoryLimit(conf); return conf; } As you can see ... it expects hbase-site.xml to be in the classpath. If your file is located in some subdirectory of your classpath base, you would have to give the full path. Or use getResourceAsStream() to get it as an InputStream and then use your Configuration.addResource(InputStream) approach to load it. --Suraj On Mon, Nov 26, 2012 at 5:02 PM, Mohit Anchlia wrote: > Thanks! This is the client code I was referring to. The below code doesn't > seem to work. Also I tried HBaseConfiguration.addHBaseResrouce and that > didn't work either. Is there any other way to make it configurable outside > the resource? > > On Mon, Nov 26, 2012 at 2:39 PM, Stack wrote: > >> On Mon, Nov 26, 2012 at 2:16 PM, Mohit Anchlia >> wrote: >> > I have a need to move hbas-site.xml to an external location. So in order >> to >> > do that I changed my configuration as shown below. But this doesn't seem >> to >> > be working. It picks up the file but I get error, seems like it's going >> to >> > the localhost. I checked hbase-site.xml in the directory and the >> zookeeper >> > nodes are correctly listed. >> > >> > >> > [11/26/2012 14:09:31,480] INFO apache.zookeeper.ClientCnxn >> > >> [[web-analytics-ci-1.0.0-SNAPSHOT].AsyncFlow.async2.02-SendThread(localhost.localdomain:2181)](): >> > Opening socket connection to server localhost.localdomain/127.0.0.1:2181 >> > >> > ----- >> > >> > changed from >> > >> > HBaseConfiguration.create() >> > >> > to >> > >> > >> > config = *new* Configuration(); >> > >> > config.addResource(*new* Path(*CONF_FILE_PROP_NAME*)); >> > >> > *log*.info("Config location picked from:" + prop); >> >> >> The above looks basically right but IIRC, this stuff can be tricky >> adding in new resources and making sure stuff is applied in order -- >> and then there is 'final' configs that are applied after yours. >> >> You could try copying the hbase conf dir to wherever, amending it to >> suit your needs and then when starting hbase, add '--config >> ALTERNATE_CONF_DIR'. >> >> St.Ack >>