You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Julian Zhou <ju...@me.com> on 2013/05/10 08:41:55 UTC

HBase Rest service start/stop with HBase service.

Hi,
Recently, lots of developments and applications were done and deployed
based on consuming HBase Rest API. For Restful servlet
(org.apache.hadoop.hbase.rest.Main (0.94),
org.apache.hadoop.hbase.rest.RESTServer (trunk)) on Jetty, we need to
first explicitly start the service (% ./bin/hbase-daemon.sh start rest
-p 8000 ) for application running. Here is a scenario, sometimes, HBase
cluster are stopped/started for maintanence, but rest is a seperated
standalone process, which binds the HBaseAdmin at construction method.
HBase stop/start cause this binding lost for existing rest servlet. Rest
servlet still exist to trying on old bound HBaseAdmin until a long time
duration later with an "Unavailable" caught via an IOException caught in
such as RootResource.

Is there any JIRA discussion on this with some questions like:
- could we pairwise the HBase service with HBase rest service with some
start/stop options? since seems no reason to still keep the rest servlet
process after HBase stopped? When HBase restarts, original rest service
could not resume to bind to the new HBase service via its old HBaseAdmin
reference?
So may we stop the rest when hbase stopped, or even if hbase was killed
by acident, restart hbase with rest option could detect the old rest
process, kill it and start to bind a new one?

>From this point of view, application rely on rest api in previous
scenario could immediately detect it when setting up http connection
session instead of wasting a long time to fail back from IOException
with "Unavailable" from rest servlet.

-- 
Best Regards, Julian


Re: HBase Rest service start/stop with HBase service.

Posted by Stack <st...@duboce.net>.
On Thu, May 9, 2013 at 11:41 PM, Julian Zhou <ju...@me.com> wrote:

> Hi,
> Recently, lots of developments and applications were done and deployed
> based on consuming HBase Rest API. For Restful servlet
> (org.apache.hadoop.hbase.rest.Main (0.94),
> org.apache.hadoop.hbase.rest.RESTServer (trunk)) on Jetty, we need to
> first explicitly start the service (% ./bin/hbase-daemon.sh start rest
> -p 8000 ) for application running. Here is a scenario, sometimes, HBase
> cluster are stopped/started for maintanence, but rest is a seperated
> standalone process, which binds the HBaseAdmin at construction method.
> HBase stop/start cause this binding lost for existing rest servlet. Rest
> servlet still exist to trying on old bound HBaseAdmin until a long time
> duration later with an "Unavailable" caught via an IOException caught in
> such as RootResource.
>

Should we just start the REST webapp beside the UI so it is always on?
St.Ack

Re: HBase Rest service start/stop with HBase service.

Posted by Jean-Daniel Cryans <jd...@apache.org>.
I've usually relied on cluster management tools when I'm at this point with
an HBase cluster, but I guess we could add the same option that we have for
ZK in hbase-env.sh, basically if you set HBASE_MANAGES_REST to true the
scripts will start/stop the REST servers on the slave machines. Same for
Thrift.

I would not go as far as adding different sets of machines a la
conf/regionservers if your Thrift or REST servers lay on different machines
than your region servers.

J-D


On Thu, May 9, 2013 at 11:41 PM, Julian Zhou <ju...@me.com> wrote:

> Hi,
> Recently, lots of developments and applications were done and deployed
> based on consuming HBase Rest API. For Restful servlet
> (org.apache.hadoop.hbase.rest.Main (0.94),
> org.apache.hadoop.hbase.rest.RESTServer (trunk)) on Jetty, we need to
> first explicitly start the service (% ./bin/hbase-daemon.sh start rest
> -p 8000 ) for application running. Here is a scenario, sometimes, HBase
> cluster are stopped/started for maintanence, but rest is a seperated
> standalone process, which binds the HBaseAdmin at construction method.
> HBase stop/start cause this binding lost for existing rest servlet. Rest
> servlet still exist to trying on old bound HBaseAdmin until a long time
> duration later with an "Unavailable" caught via an IOException caught in
> such as RootResource.
>
> Is there any JIRA discussion on this with some questions like:
> - could we pairwise the HBase service with HBase rest service with some
> start/stop options? since seems no reason to still keep the rest servlet
> process after HBase stopped? When HBase restarts, original rest service
> could not resume to bind to the new HBase service via its old HBaseAdmin
> reference?
> So may we stop the rest when hbase stopped, or even if hbase was killed
> by acident, restart hbase with rest option could detect the old rest
> process, kill it and start to bind a new one?
>
> From this point of view, application rely on rest api in previous
> scenario could immediately detect it when setting up http connection
> session instead of wasting a long time to fail back from IOException
> with "Unavailable" from rest servlet.
>
> --
> Best Regards, Julian
>
>

Re: HBase Rest service start/stop with HBase service.

Posted by Ted Yu <yu...@gmail.com>.
I am not aware of JIRA on this topic.

You can create one.

Cheers

On Thu, May 9, 2013 at 11:41 PM, Julian Zhou <ju...@me.com> wrote:

> Hi,
> Recently, lots of developments and applications were done and deployed
> based on consuming HBase Rest API. For Restful servlet
> (org.apache.hadoop.hbase.rest.Main (0.94),
> org.apache.hadoop.hbase.rest.RESTServer (trunk)) on Jetty, we need to
> first explicitly start the service (% ./bin/hbase-daemon.sh start rest
> -p 8000 ) for application running. Here is a scenario, sometimes, HBase
> cluster are stopped/started for maintanence, but rest is a seperated
> standalone process, which binds the HBaseAdmin at construction method.
> HBase stop/start cause this binding lost for existing rest servlet. Rest
> servlet still exist to trying on old bound HBaseAdmin until a long time
> duration later with an "Unavailable" caught via an IOException caught in
> such as RootResource.
>
> Is there any JIRA discussion on this with some questions like:
> - could we pairwise the HBase service with HBase rest service with some
> start/stop options? since seems no reason to still keep the rest servlet
> process after HBase stopped? When HBase restarts, original rest service
> could not resume to bind to the new HBase service via its old HBaseAdmin
> reference?
> So may we stop the rest when hbase stopped, or even if hbase was killed
> by acident, restart hbase with rest option could detect the old rest
> process, kill it and start to bind a new one?
>
> From this point of view, application rely on rest api in previous
> scenario could immediately detect it when setting up http connection
> session instead of wasting a long time to fail back from IOException
> with "Unavailable" from rest servlet.
>
> --
> Best Regards, Julian
>
>

Re: HBase Rest service start/stop with HBase service.

Posted by Julian Zhou <ju...@me.com>.
Hi Andrew,
Just fired 8533 for this topic. Would it be a simplest approach that to 
just pairwise the rest serive with hbase service in start/stop script?
Client reconnecting for an open HBaseAdmin handle for a bounced cluster 
could be another enhancement in the future, then beside the above change 
at script level, even keeping the rest process when hbase died makes 
sense to waiting for reconnection?

于 5/11/2013 9:30 AM, Andrew Purtell 写道:
> Originally the REST gateway would create an HBaseAdmin on demand whenever
> one is needed but that slows things down and consumes local and cluster
> resources unnecessarily for the common case. I could switch it back to the
> old behavior, you are welcome to file a JIRA for that. Would not be
> unreasonable to file a JIRA for automatic reconnection of an open
> HBaseAdmin handle after a cluster bounce in addition or as an alternative,
> that's an HBase client change. Or, you can simply bounce the REST gateways
> with your ops automation along with the rest of the cluster?
>
>
> On Fri, May 10, 2013 at 2:41 PM, Julian Zhou <ju...@me.com> wrote:
>
>> Hi,
>> Recently, lots of developments and applications were done and deployed
>> based on consuming HBase Rest API. For Restful servlet
>> (org.apache.hadoop.hbase.rest.Main (0.94),
>> org.apache.hadoop.hbase.rest.RESTServer (trunk)) on Jetty, we need to
>> first explicitly start the service (% ./bin/hbase-daemon.sh start rest
>> -p 8000 ) for application running. Here is a scenario, sometimes, HBase
>> cluster are stopped/started for maintanence, but rest is a seperated
>> standalone process, which binds the HBaseAdmin at construction method.
>> HBase stop/start cause this binding lost for existing rest servlet. Rest
>> servlet still exist to trying on old bound HBaseAdmin until a long time
>> duration later with an "Unavailable" caught via an IOException caught in
>> such as RootResource.
>>
>> Is there any JIRA discussion on this with some questions like:
>> - could we pairwise the HBase service with HBase rest service with some
>> start/stop options? since seems no reason to still keep the rest servlet
>> process after HBase stopped? When HBase restarts, original rest service
>> could not resume to bind to the new HBase service via its old HBaseAdmin
>> reference?
>> So may we stop the rest when hbase stopped, or even if hbase was killed
>> by acident, restart hbase with rest option could detect the old rest
>> process, kill it and start to bind a new one?
>>
>>  From this point of view, application rely on rest api in previous
>> scenario could immediately detect it when setting up http connection
>> session instead of wasting a long time to fail back from IOException
>> with "Unavailable" from rest servlet.
>>
>> --
>> Best Regards, Julian
>>
>>
>


-- 
Best Regards, Julian


Re: HBase Rest service start/stop with HBase service.

Posted by Andrew Purtell <ap...@apache.org>.
Originally the REST gateway would create an HBaseAdmin on demand whenever
one is needed but that slows things down and consumes local and cluster
resources unnecessarily for the common case. I could switch it back to the
old behavior, you are welcome to file a JIRA for that. Would not be
unreasonable to file a JIRA for automatic reconnection of an open
HBaseAdmin handle after a cluster bounce in addition or as an alternative,
that's an HBase client change. Or, you can simply bounce the REST gateways
with your ops automation along with the rest of the cluster?


On Fri, May 10, 2013 at 2:41 PM, Julian Zhou <ju...@me.com> wrote:

> Hi,
> Recently, lots of developments and applications were done and deployed
> based on consuming HBase Rest API. For Restful servlet
> (org.apache.hadoop.hbase.rest.Main (0.94),
> org.apache.hadoop.hbase.rest.RESTServer (trunk)) on Jetty, we need to
> first explicitly start the service (% ./bin/hbase-daemon.sh start rest
> -p 8000 ) for application running. Here is a scenario, sometimes, HBase
> cluster are stopped/started for maintanence, but rest is a seperated
> standalone process, which binds the HBaseAdmin at construction method.
> HBase stop/start cause this binding lost for existing rest servlet. Rest
> servlet still exist to trying on old bound HBaseAdmin until a long time
> duration later with an "Unavailable" caught via an IOException caught in
> such as RootResource.
>
> Is there any JIRA discussion on this with some questions like:
> - could we pairwise the HBase service with HBase rest service with some
> start/stop options? since seems no reason to still keep the rest servlet
> process after HBase stopped? When HBase restarts, original rest service
> could not resume to bind to the new HBase service via its old HBaseAdmin
> reference?
> So may we stop the rest when hbase stopped, or even if hbase was killed
> by acident, restart hbase with rest option could detect the old rest
> process, kill it and start to bind a new one?
>
> From this point of view, application rely on rest api in previous
> scenario could immediately detect it when setting up http connection
> session instead of wasting a long time to fail back from IOException
> with "Unavailable" from rest servlet.
>
> --
> Best Regards, Julian
>
>


-- 
Best regards,

   - Andy

Problems worthy of attack prove their worth by hitting back. - Piet Hein
(via Tom White)