Return-Path: Delivered-To: apmail-hadoop-hbase-dev-archive@minotaur.apache.org Received: (qmail 67454 invoked from network); 11 May 2010 16:31:57 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 11 May 2010 16:31:57 -0000 Received: (qmail 85051 invoked by uid 500); 11 May 2010 16:31:56 -0000 Delivered-To: apmail-hadoop-hbase-dev-archive@hadoop.apache.org Received: (qmail 85000 invoked by uid 500); 11 May 2010 16:31:56 -0000 Mailing-List: contact hbase-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hbase-dev@hadoop.apache.org Delivered-To: mailing list hbase-dev@hadoop.apache.org Received: (qmail 84992 invoked by uid 99); 11 May 2010 16:31:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 May 2010 16:31:56 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=10.0 tests=AWL,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jdcryans@gmail.com designates 209.85.221.172 as permitted sender) Received: from [209.85.221.172] (HELO mail-qy0-f172.google.com) (209.85.221.172) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 May 2010 16:31:51 +0000 Received: by qyk2 with SMTP id 2so42515qyk.20 for ; Tue, 11 May 2010 09:31:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; bh=+pQ8svqGZYHgPC/eQVOcc2RIl8MDDPGSyl+OpDyRTl4=; b=KaToty3/fnD+4P7pnES32fBjop1Xdq79lQsWBeHADCdh0eA9aLMvA3i1ogN9te5qnk 8tZTcCzBGeXyi2szQbibmps9Bcfv3gMvrVWMj1MdbkFHmn40PCRDlx//WrfCwdLCEJYB i7cAZKgLYqIv5GFWTetOnOAYUCDyDqVg44cUg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=jzivt38WNVXF4J20SWtDubUqqLyHNrqnU+o4eJWH1moG5n/T4G+LlJh5Dusar6EuWq +AGwahsimwhnr8lNmj10M/iIATfyP03yXRNn3OCSzfN9dB0Y28Mo8IBqhkOqr1b0FGcW qCYIYjjHWEvyWkqCdAP9e+z0oy9fwCqCgguj4= MIME-Version: 1.0 Received: by 10.224.34.219 with SMTP id m27mr4040932qad.54.1273595487436; Tue, 11 May 2010 09:31:27 -0700 (PDT) Sender: jdcryans@gmail.com Received: by 10.229.49.12 with HTTP; Tue, 11 May 2010 09:31:27 -0700 (PDT) In-Reply-To: <4BE94FBE.7090407@gmx.de> References: <17e273101003291401m7b692d41i3fb8a51068b5c7c3@mail.gmail.com> <31a243e71003291425w5e3b3024h1ced276db047af89@mail.gmail.com> <17e273101003291435w6b160921xeda7d457f3f7226@mail.gmail.com> <4BE94FBE.7090407@gmx.de> Date: Tue, 11 May 2010 09:31:27 -0700 X-Google-Sender-Auth: KC053ASxt65iwkKV9YbhLSb-EPI Message-ID: Subject: Re: connection.isMasterRunning() From: Jean-Daniel Cryans To: hbase-dev@hadoop.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Check if in Zookeeper the znode /hbase/master is there. You can easily do this by using org.apache.hadoop.hbase.zookeeper.ZooKeeperWrapper.readMasterAddressOrThrow= (). This method isn't static, you have to create your own instance. J-D On Tue, May 11, 2010 at 5:38 AM, Al Lias wrote: > Am 29.03.2010 23:35, schrieb Ted Yu: >> https://issues.apache.org/jira/browse/HBASE-2391 has been filed. >> >> We call HBaseAdmin.isMasterRunning() to see if client has connection wit= h >> HBase. If there is a working alternative, we'd love to use it. >> > > Just to catch up on this....what is the recommended way to > programmatically check if Hbase is up (say on 0.20.4)? > > Thx, > > =A0 =A0 =A0 =A0Al > >> ... >> On Mon, Mar 29, 2010 at 2:25 PM, Jean-Daniel Cryans wrote: >> >>> I think this method wasn't updated when we moved to Zookeeper (since >>> in pre-0.20, dead master =3D dead cluster), also looking at when this i= s >>> called, I only see it from HMerge and HBaseAdmin.isMasterRunning()... >>> which in turn isn't called anywhere in the java code (I think we call >>> it in the shell tho). >>> >>> So we should first consider if this method is useful at all, and if so >>> then what would be the best fix. For example, if you run a HMerge >>> while the master is down but the region servers are up, you're going >>> to end up with something wrong since it expects hbase to be completely >>> down. >>> >>> Can you open a jira to continue discussions there? >>> >>> Thx! >>> >>> J-D >>> >>> On Mon, Mar 29, 2010 at 2:01 PM, Ted Yu wrote: >>>> Hi, >>>> While going over TableServers.isMasterRunning() in HConnectionManager,= I >>> see >>>> this: >>>> =A0 =A0public boolean isMasterRunning() { >>>> =A0 =A0 =A0if (this.master =3D=3D null) { >>>> =A0 =A0 =A0 =A0try { >>>> =A0 =A0 =A0 =A0 =A0getMaster(); >>>> >>>> =A0 =A0 =A0 =A0} catch (MasterNotRunningException e) { >>>> =A0 =A0 =A0 =A0 =A0return false; >>>> =A0 =A0 =A0 =A0} >>>> =A0 =A0 =A0} >>>> =A0 =A0 =A0return true; >>>> =A0 =A0} >>>> When isMasterRunning() is called the first time, if master is obtained >>>> successfully, master field would contain reference to HMasterInterface= . >>>> Subsequent calls to isMasterRunning() wouldn't throw >>>> MasterNotRunningException even if master server stops responding to >>> clients. >>>> >>>> I think master.isMasterRunning() should be called if master isn't null= . >>>> >>>> Regards >>>> >>> >> > >