> Sorry, there is something I asked wrongly because I was understanding it
wrongly.
> 1 region server correspond to 1 namenode and 1 write to 1 name node will
replicate to 3 datanodes...

No, but this may just be a terminology problem.

The NameNode isn't an HBase daemon, it's HDFS.

HDFS writers, such as HBase RegionServers, don't write through the
NameNode, they write to DataNodes directly. (Strictly speaking, they write
to one DataNode, which pipelines the write to another, which pipelines it
to another, out to as many replicas as are configured for the file, default
3.)

>
​
So to simplify the second question, what happens to the HBase cluster when
1 region server is down?

At a high level:

A region server crashes.

Any clients trying to read and write to it will experience network errors
and will, for a configured interval, attempt retries. By client here I mean
the HBase client library. Unless you have default error handling tuned
down, the client library will try to ride over transient region
availability issues.

We use ZooKeeper for process liveness tracking. This is an internal detail.
Suffice to say at high level after the crashed regionserver misses a
heartbeat the master will be informed the region server has crashed. The
heartbeat interval can be tuned to trade off between mean-time-to-recovery
and sensitivity to transient network, host, or JVM (GC) issues.

Upon learning the regionserver has crashed, the master will reassign its
regions to other live regionservers and update all necessary metadata.

Clients, upon further retry, will learn the new location and redirect their
next retry to the new location. (As you may have noticed the retry behavior
of the client is configurable. IF you have retries tuned down then the
client may have given up before the master was notified that the
regionserver crashed and/or before the reassigned regions became live. If
that's the case, then the application will receive an exception indicating
failure and retry will have to happen at the application level.)




On Tue, Apr 7, 2015 at 10:36 AM, Marcelo Valle (BLOOMBERG/ LONDON) <
[email protected]> wrote:

> Sorry, there is something I asked wrongly because I was understanding it
> wrongly.
> 1 region server correspond to 1 namenode and 1 write to 1 name node will
> replicate to 3 datanodes...
>
> ​​
> So to simplify the second question, what happens to the HBase cluster when
> 1 region server is down?
>
> -Marcelo
>
>
> From: Marcelo Valle (BLOOMBERG/ LONDON)
> Subject: Re: write availability
>
> Esteban,
>
> If I understood correctly what you said:
>
> > "For the failure mode you mention if all DNs go down (not the NN)
> clients will be blocked waiting for the acknowledge of a write to the DNs
> and after few retries the RS will consider there was a failure writing to
> the WAL, the RS will attempt to roll the WAL for a last time and if fails
> at this point the RS will consider this as a fatal condition and it will
> shutdown it self. At this point the client probably ran out of retries and
> will throw an exception to the application."
>
> If this scenario happens, when will my application be available to accept
> writes for that region again? When I do some manual intervention on the
> server?
>
> For example: support I split data by user ids, so each user is stored in a
> different region. In the scenario above, my application (and also the HBase
> cluster) would be working for some users and wouldn't be working for users
> whose user id is in a "down region" (a region where all corresponding DNs
> are down, considering 1 DN per RS). Is this right?
>
> -Marcelo.
>
> From: [email protected]
> Subject: Re: write availability
>
>
> Hello Marcelo,
>
> HBase has strong durability guarantees to avoid data loss. When a write
> arrives to a RegionServer data will be persisted into a Write-Ahead-Log (on
> HDFS) and temporarily in the RegionServer memory until the data from this
> memory store is flushed (also to HDFS).
>
> For the point of view of a client that is writing to HBase, if it
> receives a response for a successful write operation (put, delete, append,
> increment) then we can guarantee that data was correctly persisted to HDFS
> in the WAL and in case of a catastrophic failure of a RegionServer we will
> be able to recover as others have mentioned.
>
> For the failure mode you mention if all DNs go down (not the NN) clients
> will be blocked waiting for the acknowledge of a write to the DNs and after
> few retries the RS will consider there was a failure writing to the WAL,
> the RS will attempt to roll the WAL for a last time and if fails at this
> point the RS will consider this as a fatal condition and it will shutdown
> it self. At this point the client probably ran out of retries and will
> throw an exception to the application.
>
> If a single DN can recover before any of the RSs goes down, the writes
> will recover and the client will get the acknowledge that data has been
> persisted to HDFS (even with a single DN at this point), during this period
> the RS logs will warn that data is getting persisted with a lower number of
> replicas and data could be at risk.
>
> If you are further interested in the write path in HBase there is a really
> good blog post from Jimmy Xiang about this topic:
> http://blog.cloudera.com/blog/2012/06/hbase-write-path
>
> best,
> esteban.
>
>
> --
> Cloudera, Inc.
>
>
> On Tue, Apr 7, 2015 at 9:04 AM, Marcelo Valle (BLOOMBERG/ LONDON) <
> [email protected]> wrote:
>
> Wellington,
>
> I might be misinterpreting this:
> http://stackoverflow.com/questions/13741946/role-of-datanode-regionserver-in-hbase-hadoop-integration
>
> But aren't HBase region servers and HDFS datanodes always in the same
> server? With a replication factor of 3, what happens if all 3 datanodes
> hosting that information go down and one of them come back, but with the
> disk intact? Considering from the time they went down to the time it went
> back HBase received new writes that would go to the same data node...
>
>
> From: [email protected]
> Subject: Re: write availability
>
> The data is stored on files on hdfs. If a RS goes down, the master knows
> which regions were on that RS and which hdfs files contain data for these
> regions, so it will just assign the regions to others RS, and these others
> RS will have access to the regions data because it's stored on HDFS. The RS
> does not "own" the disk, this is HDFS job, so the recovery on this case is
> transparent.
>
>
> On 7 Apr 2015, at 16:51, Marcelo Valle (BLOOMBERG/ LONDON) <
> [email protected]> wrote:
>
> > So if a RS goes down, it's assumed you lost the data on it, right?
> > HBase has replications on HDFS, so if a RS goes down it doesn't mean I
> lost all the data, as I could have the replicas yet... But what happens if
> all RS hosting a specific region goes down?
> > What if one RS from this one comes back again, but with the disk intact,
> with all the data it had before crashing?
> >
> >
> > From: [email protected]
> > Subject: Re: write availability
> >
> > When a RS goes down, the Master will try to assign the regions on the
> remaining RSes. When the RS comes back, after a while, the Master balancer
> process will re-distribute regions between RS, so the given RS will be
> hosting regions, but not necessarily the one it used to host before it went
> down.
> >
> >
> > On 7 Apr 2015, at 16:31, Marcelo Valle (BLOOMBERG/ LONDON) <
> [email protected]> wrote:
> >
> >>> So if the cluster is up, then you can insert records in to HBase even
> though you lost a RS that was handing a specific region.
> >>
> >> What happens when the RS goes down? Writes to that region will be
> written to another region server? Another RS assumes the region "range"
> while the RS is down?
> >>
> >> What happens when the RS that was down goes up again?
> >>
> >>
> >> From: [email protected]
> >> Subject: Re: write availability
> >>
> >> I don’t know if I would say that…
> >>
> >> I read Marcelo’s question of “if the cluster is up, even though a RS
> may be down, can I still insert records in to HBase?”
> >>
> >> So if the cluster is up, then you can insert records in to HBase even
> though you lost a RS that was handing a specific region.
> >>
> >> But because he talked about syncing nodes… I could be misreading his
> initial question…
> >>
> >>> On Apr 7, 2015, at 9:02 AM, Serega Sheypak <[email protected]>
> wrote:
> >>>
> >>>> If I have an application that writes to a HBase cluster, can I count
> that
> >>> the cluster will always available to receive writes?
> >>> No, it's CP, not AP system.
> >>>> so everything get in sync when the other nodes get up again
> >>> There is no hinted backoff, It's not Cassandra.
> >>>
> >>>
> >>>
> >>> 2015-04-07 14:48 GMT+02:00 Marcelo Valle (BLOOMBERG/ LONDON) <
> >>> [email protected]>:
> >>>
> >>>> If I have an application that writes to a HBase cluster, can I count
> that
> >>>> the cluster will always available to receive writes?
> >>>> I might not be able to read if a region server which handles a range
> of
> >>>> keys is down, but will I be able to keep writing to other nodes, so
> >>>> everything get in sync when the other nodes get up again?
> >>>> Or I might get no write availability for a while?
> >>
> >> The opinions expressed here are mine, while they may reflect a
> cognitive thought, that is purely accidental.
> >> Use at your own risk.
> >> Michael Segel
> >> michael_segel (AT) hotmail.com
> >
> >
>
>
>


-- 
Best regards,

   - Andy

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

Reply via email to