Return-Path: Delivered-To: apmail-hadoop-hbase-user-archive@locus.apache.org Received: (qmail 49040 invoked from network); 29 Feb 2008 06:02:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Feb 2008 06:02:28 -0000 Received: (qmail 12594 invoked by uid 500); 29 Feb 2008 06:02:23 -0000 Delivered-To: apmail-hadoop-hbase-user-archive@hadoop.apache.org Received: (qmail 12581 invoked by uid 500); 29 Feb 2008 06:02:23 -0000 Mailing-List: contact hbase-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hbase-user@hadoop.apache.org Delivered-To: mailing list hbase-user@hadoop.apache.org Received: (qmail 12572 invoked by uid 99); 29 Feb 2008 06:02:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Feb 2008 22:02:23 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [63.203.238.117] (HELO dns.duboce.net) (63.203.238.117) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Feb 2008 06:01:35 +0000 Received: by dns.duboce.net (Postfix, from userid 1008) id 1EA40C566; Thu, 28 Feb 2008 20:26:57 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-26) on dns.duboce.net X-Spam-Level: Received: from durruti.local (unknown [192.168.1.33]) by dns.duboce.net (Postfix) with ESMTP id 54A81C256 for ; Thu, 28 Feb 2008 20:26:52 -0800 (PST) Message-ID: <47C79F34.2070100@duboce.net> Date: Thu, 28 Feb 2008 21:59:16 -0800 From: stack User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: hbase-user@hadoop.apache.org Subject: Re: Question about exception MasterNotRunningException when running HBaseAdmin and HTable in MapReduce program References: <8e8d18110802281858r372d8eact8cd437868f433a1e@mail.gmail.com> <1204259255.3140.5.camel@latewhatgrow-lx.eglbp.corp.yahoo.com> <8e8d18110802282157g7a42906aka42a9004845658f2@mail.gmail.com> In-Reply-To: <8e8d18110802282157g7a42906aka42a9004845658f2@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.4 Is HBASE_HOME defined when the hadoop-env.sh runs? Try expanding it? Rather than adding HBASE_CONF_DIR, add the conf dir to the HADOOP_CLASSPATH (I just updated the example in the wiki page to include the conf dir if that helps). Your code looks fine. St.Ack Andy Li wrote: > Thanks for your response. > > Here is the following configuration I am using in hadoop-env.sh. > For those not pasted, they are the default values within hadoop-env.sh along > the package. > > ======= COPY/PASTE STARTS HERE ======== > export JAVA_HOME=/usr/java/jdk1.6.0_04 > export HBASE_HOME=/opt/hadoop/contrib/hbase > export HADOOP_CLASSPATH=$HBASE_HOME/hbase- > 0.2.0-dev.jar:$HBASE_HOME/hbase-0.2.0-dev-test.jar:$HBASE_HOME/lib/ > ======= COPY/PASTE ENDS HERE ======== > > Do I have to explicitly specified HBASE_CONF_DIR in hadoop-env.sh? > > I'm still getting the same exception. Here is a snippet of my code that > tries to access HBase. > ======= COPY/PASTE STARTS HERE ======== > HBaseConfiguration _CONF = new HBaseConfiguration(); > Text t_ratio = new Text("ratio:"); > Text _TABLENAME = new Text("andrew-intelligent-table"); > HTableDescriptor _DESC = new HTableDescriptor("test-mapreduce-table"); > _DESC.addFamily(new HColumnDescriptor(new String("ratio:"))); > HBaseAdmin _ADMIN = null; > HTable _TABLE = null; > try { > _ADMIN = new HBaseAdmin(_CONF); > if ( !(_ADMIN.tableExists(_TABLENAME)) ) { > System.out.println("Table don't exist, create new table"); > _ADMIN.createTable(_DESC); > } > _TABLE = new HTable(_CONF, _TABLENAME); > } catch (Exception exx) { > System.out.println("Error happen when opening the tables"); > exx.printStackTrace(); > } > ======= COPY/PASTE ENDS HERE ======== > > Any help or input is appreciated. Thanks. > > -annndy > > On Thu, Feb 28, 2008 at 8:27 PM, Peeyush Bishnoi > wrote: > > >> Hi Andy , >> >> Check for the $HADOOP_CLASSPATH , in hadoop-env.sh , which should have >> entries with hbase jar file and HBASE_CONF_DIR and entries should be >> exported properly. This hadoop-env.sh should be set on all the machines >> in a cluster where your HRegionserver is running . >> >> hbase-site.xml file should have HMaster value set . >> >> --- >> Peeyush >> >> >> On Thu, 2008-02-28 at 18:58 -0800, Andy Li wrote: >> >> >>> Dears, >>> >>> Not sure if anyone encountered the same problem. >>> I am running hadoop 0.17 with HBase 0.2 on Linux x86_64 with JDK 1.6. >>> >>> I get the following exception in my program when I tries to invoke the >>> HBaseAdmin >>> and HTable in the 'reduce' phase to insert data into the table. I keep >>> getting the same >>> exception when I try to get a HTable reference. I can run Hbase Shell, >>> >> but >> >>> cannot make >>> the MR program work. >>> >>> org.apache.hadoop.hbase.MasterNotRunningException >>> at >>> >> org.apache.hadoop.hbase.client.HConnectionManager$TableServers.getMaster >> >>> (HCon >>> nectionManager.java:206) >>> at org.apache.hadoop.hbase.client.HBaseAdmin.(HBaseAdmin.java:70) >>> at hbasetest.mapreduce.URLHBaseDictReduce.reduce(URLHBaseDictReduce.java >>> >> :68) >> >>> at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:333) >>> at org.apache.hadoop.mapred.TaskTracker$Child.main(TaskTracker.java >>> >> :2089) >> >>> java.lang.NullPointerException >>> at hbasetest.mapreduce.URLHBaseDictReduce.reduce(URLHBaseDictReduce.java >>> :148) >>> at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:333) >>> at org.apache.hadoop.mapred.TaskTracker$Child.main(TaskTracker.java >>> >> :2089) >> >>> >>> Any idea? >>> >>> Thanks, >>> annndy >>> > >