hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Evgeny Ryabitskiy (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (HBASE-1145) Ensure that there is only 1 Master with Zookeeper
Date Sun, 25 Jan 2009 00:53:59 GMT

    [ https://issues.apache.org/jira/browse/HBASE-1145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666953#action_12666953

apparition edited comment on HBASE-1145 at 1/24/09 4:52 PM:

For this issue can be used Leader Election algorithm   http://hadoop.apache.org/zookeeper/docs/r3.0.1/recipes.html#sc_leaderElection

1) Create a znode for master election if it not exists:
      create("master-election", new byte[0], PERSISTENT);
if node exits, catch NodeExistsException and keep going

2) create("master-election/master-", new byte[0], EPHEMERAL_SEQUENTIAL);
     //in a data can be stored some information about master (it's location or session ID)
3) getChildren("master-election", false);
    if there is only one child (that was just created) then master becomes ACTIVE;
4) else 
    let j be smallest SEQUENTIAL number for master nodes
5) exists("master-election/master-" + j, true);
if exists go to 3
become a "hot-ready" master wait till EVENT (triggering of watch)
fi event goto 3

      was (Author: apparition):
    For this issue can be used Ephemeral ZNode created by HMaster.

HMaster can use following algorithm for enshuring:

1) after establishing connection to ZK:
     exists(masterZNode, false);
2.1) if NOT exists:
     create(masterZNode, "Master is connected!",EPHEMERAL);
2.2)  if exists:
     Master is already connected to ZK! 
     close connection;  exit Master with fail
> Ensure that there is only 1 Master with Zookeeper
> -------------------------------------------------
>                 Key: HBASE-1145
>                 URL: https://issues.apache.org/jira/browse/HBASE-1145
>             Project: Hadoop HBase
>          Issue Type: Sub-task
>            Reporter: Jean-Daniel Cryans
>            Assignee: Evgeny Ryabitskiy

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message