hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Marc Spaggiari <jean-m...@spaggiari.org>
Subject Re: How to detect whether hbase cluster is up and ready for accepting requests.
Date Wed, 02 Sep 2015 12:56:00 GMT
I guess you can also use something like this:

public class TestInstallation {
  private static final Log LOG = LogFactory.getLog(TestInstallation.class);

  public static void main(String[] args) {
    Configuration conf = HBaseConfiguration.create();
    try {
      LOG.info("Testing HBase connection...");
      HBaseAdmin.checkHBaseAvailable(conf);
      LOG.info("HBase is running correctly...");
    } catch (MasterNotRunningException e) {
      LOG.error("Unable to find a running HBase instance", e);
    } catch (ZooKeeperConnectionException e) {
      LOG.error("Unable to connect to ZooKeeper", e);
    } catch (ServiceException e) {
      LOG.error("HBase service unavailable", e);
    } catch (IOException e) {
      LOG.error("Error when trying to get HBase status", e);
    }
  }
}


2015-09-01 22:53 GMT-04:00 Ted Yu <yuzhihong@gmail.com>:

> If you mean events related to region transition, to my knowledge, there is
> no much notification.
>
> You need to poll cluster status.
>
>
>
> > On Sep 1, 2015, at 7:46 PM, James Teng <tenglinxiao@outlook.com> wrote:
> >
> > Can we register any observer or listener for related events? so we can
> customize some actions when the cluster is up.
> >
> > uknow.
> > ________________________________________
> > From: Ted Yu <yuzhihong@gmail.com>
> > Sent: Tuesday, September 1, 2015 2:37 PM
> > To: user@hbase.apache.org
> > Subject: Re: How to detect whether hbase cluster is up and ready for
> accepting requests.
> >
> > Looks like the link Samir shared is missing the following method:
> >
> >  public Map<String, RegionState> getRegionsInTransition() {
> >
> > FYI
> >
> >> On Tue, Sep 1, 2015 at 5:28 AM, Samir Ahmic <ahmic.samir@gmail.com>
> wrote:
> >>
> >> Hi,
> >> Depending on your hbase version you can get ClusterStatus over api.
> >>
> >>
> https://hbase.apache.org/apidocs/org/apache/hadoop/hbase/ClusterStatus.html
> >>
> >> Regards
> >> Samir
> >>
> >> On Tue, Sep 1, 2015 at 2:03 PM, James Teng <tenglinxiao@outlook.com>
> >> wrote:
> >>
> >>> Just as mentioned in the subject, is there any api to detect whether
> >>> cluster is up, all regions are opened and ready for requests?
> >>>
> >>>
> >>>
> >>> uknow.
> >>
>

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