You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Nicolas Spiegelberg (JIRA)" <ji...@apache.org> on 2010/07/23 22:38:51 UTC
[jira] Created: (HBASE-2870) Add Backup CLI Option to HMaster
Add Backup CLI Option to HMaster
--------------------------------
Key: HBASE-2870
URL: https://issues.apache.org/jira/browse/HBASE-2870
Project: HBase
Issue Type: New Feature
Reporter: Nicolas Spiegelberg
Assignee: Karthik Ranganathan
Priority: Minor
Fix For: 0.90.0
The HMaster main() should allow a toggle like --backup, which forces it to be a secondary master on startup versus a primary candidate. That way, we can start up multiple masters at once and deterministically know which one will be the original primary.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HBASE-2870) Add Backup CLI Option to HMaster
Posted by "HBase Review Board (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12896743#action_12896743 ]
HBase Review Board commented on HBASE-2870:
-------------------------------------------
Message from: "Nicolas" <ns...@facebook.com>
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://review.cloudera.org/r/592/
-----------------------------------------------------------
Review request for hbase.
Summary
-------
Adds '--backup' option to HMaster. All backup masters will wait until a primary master has written the /hbase/master znode before poll waiting. This allows us to have a deterministic primary master while starting up multiple masters. Note that you can specify a list of backup masters to automatically start/stop via the 'conf/backup-masters' file.
This addresses bug HBASE-2870.
http://issues.apache.org/jira/browse/HBASE-2870
Diffs
-----
trunk/bin/hbase-config.sh 983803
trunk/bin/hbase-daemons.sh 983803
trunk/bin/local-master-backup.sh 983803
trunk/bin/master-backup.sh PRE-CREATION
trunk/bin/start-hbase.sh 983803
trunk/bin/stop-hbase.sh 983803
trunk/src/main/java/org/apache/hadoop/hbase/HConstants.java 983803
trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java 983803
trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java 983803
Diff: http://review.cloudera.org/r/592/diff
Testing
-------
Thanks,
Nicolas
> Add Backup CLI Option to HMaster
> --------------------------------
>
> Key: HBASE-2870
> URL: https://issues.apache.org/jira/browse/HBASE-2870
> Project: HBase
> Issue Type: New Feature
> Reporter: Nicolas Spiegelberg
> Assignee: Karthik Ranganathan
> Priority: Minor
> Fix For: 0.90.0
>
>
> The HMaster main() should allow a toggle like --backup, which forces it to be a secondary master on startup versus a primary candidate. That way, we can start up multiple masters at once and deterministically know which one will be the original primary.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HBASE-2870) Add Backup CLI Option to HMaster
Posted by "stack (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
stack updated HBASE-2870:
-------------------------
Attachment: HBASE-2870-2.patch
The patch I'm about to commit carried over from review.hbase.org.
> Add Backup CLI Option to HMaster
> --------------------------------
>
> Key: HBASE-2870
> URL: https://issues.apache.org/jira/browse/HBASE-2870
> Project: HBase
> Issue Type: New Feature
> Reporter: Nicolas Spiegelberg
> Assignee: Karthik Ranganathan
> Priority: Minor
> Fix For: 0.90.0
>
> Attachments: HBASE-2870-2.patch
>
>
> The HMaster main() should allow a toggle like --backup, which forces it to be a secondary master on startup versus a primary candidate. That way, we can start up multiple masters at once and deterministically know which one will be the original primary.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HBASE-2870) Add Backup CLI Option to HMaster
Posted by "HBase Review Board (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12896932#action_12896932 ]
HBase Review Board commented on HBASE-2870:
-------------------------------------------
Message from: "Nicolas" <ns...@facebook.com>
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://review.cloudera.org/r/592/
-----------------------------------------------------------
(Updated 2010-08-10 09:28:45.319671)
Review request for hbase.
Changes
-------
updated patch per stack's request
Summary
-------
Adds '--backup' option to HMaster. All backup masters will wait until a primary master has written the /hbase/master znode before poll waiting. This allows us to have a deterministic primary master while starting up multiple masters. Note that you can specify a list of backup masters to automatically start/stop via the 'conf/backup-masters' file.
This addresses bug HBASE-2870.
http://issues.apache.org/jira/browse/HBASE-2870
Diffs (updated)
-----
trunk/bin/hbase-config.sh 983869
trunk/bin/hbase-daemons.sh 983869
trunk/bin/local-master-backup.sh 983869
trunk/bin/master-backup.sh PRE-CREATION
trunk/bin/start-hbase.sh 983869
trunk/bin/stop-hbase.sh 983869
trunk/src/main/java/org/apache/hadoop/hbase/HConstants.java 983869
trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java 983869
trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java 983869
Diff: http://review.cloudera.org/r/592/diff
Testing
-------
Thanks,
Nicolas
> Add Backup CLI Option to HMaster
> --------------------------------
>
> Key: HBASE-2870
> URL: https://issues.apache.org/jira/browse/HBASE-2870
> Project: HBase
> Issue Type: New Feature
> Reporter: Nicolas Spiegelberg
> Assignee: Karthik Ranganathan
> Priority: Minor
> Fix For: 0.90.0
>
>
> The HMaster main() should allow a toggle like --backup, which forces it to be a secondary master on startup versus a primary candidate. That way, we can start up multiple masters at once and deterministically know which one will be the original primary.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (HBASE-2870) Add Backup CLI Option to HMaster
Posted by "stack (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
stack resolved HBASE-2870.
--------------------------
Hadoop Flags: [Reviewed]
Resolution: Fixed
Committed. Thanks for the patch Nicolas.
> Add Backup CLI Option to HMaster
> --------------------------------
>
> Key: HBASE-2870
> URL: https://issues.apache.org/jira/browse/HBASE-2870
> Project: HBase
> Issue Type: New Feature
> Reporter: Nicolas Spiegelberg
> Assignee: Nicolas Spiegelberg
> Priority: Minor
> Fix For: 0.90.0
>
> Attachments: HBASE-2870-2.patch
>
>
> The HMaster main() should allow a toggle like --backup, which forces it to be a secondary master on startup versus a primary candidate. That way, we can start up multiple masters at once and deterministically know which one will be the original primary.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HBASE-2870) Add Backup CLI Option to HMaster
Posted by "stack (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
stack updated HBASE-2870:
-------------------------
Attachment: 2870-mend.txt
Here is the mend I made on Master to restore what I broke when I applied hbase-2692, master rewrite. It adds a new method to ActiveMasterManager -- isActiveMaster -- and then before going on to block on obtaining the Master mantel -- it checks first to see if designated a backup master and if so, loops till isActiveMaster is set.
> Add Backup CLI Option to HMaster
> --------------------------------
>
> Key: HBASE-2870
> URL: https://issues.apache.org/jira/browse/HBASE-2870
> Project: HBase
> Issue Type: New Feature
> Reporter: Nicolas Spiegelberg
> Assignee: Nicolas Spiegelberg
> Priority: Minor
> Fix For: 0.90.0
>
> Attachments: 2870-mend.txt, HBASE-2870-2.patch
>
>
> The HMaster main() should allow a toggle like --backup, which forces it to be a secondary master on startup versus a primary candidate. That way, we can start up multiple masters at once and deterministically know which one will be the original primary.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Reopened: (HBASE-2870) Add Backup CLI Option to HMaster
Posted by "stack (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
stack reopened HBASE-2870:
--------------------------
I broke this merging in master rewrite hbase-2691. Reopening to fix.
> Add Backup CLI Option to HMaster
> --------------------------------
>
> Key: HBASE-2870
> URL: https://issues.apache.org/jira/browse/HBASE-2870
> Project: HBase
> Issue Type: New Feature
> Reporter: Nicolas Spiegelberg
> Assignee: Nicolas Spiegelberg
> Priority: Minor
> Fix For: 0.90.0
>
> Attachments: HBASE-2870-2.patch
>
>
> The HMaster main() should allow a toggle like --backup, which forces it to be a secondary master on startup versus a primary candidate. That way, we can start up multiple masters at once and deterministically know which one will be the original primary.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HBASE-2870) Add Backup CLI Option to HMaster
Posted by "HBase Review Board (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12896788#action_12896788 ]
HBase Review Board commented on HBASE-2870:
-------------------------------------------
Message from: "Nicolas" <ns...@facebook.com>
bq. On 2010-08-09 20:33:12, stack wrote:
bq. > I applied patch and built. On shutdown of a standalone instance I got this:
bq. >
bq. > "pynchon-305:trunk stack$ ./bin/stop-hbase.sh
bq. > stopping hbase................../Users/stack/checkouts/trunk/bin/hbase-daemons.sh: line 49: /Users/stack/checkouts/trunk/bin/master-backup.sh: Permission denied
bq. > /Users/stack/checkouts/trunk/bin/hbase-daemons.sh: line 49: exec: /Users/stack/checkouts/trunk/bin/master-backup.sh: cannot execute: Unknown error: 0"
bq. >
bq. > My script looks to have x perms:
bq. >
bq. > pynchon-305:trunk stack$ ls -la bin/hbase-daemons.sh
bq. > -rwxr-xr-x 1 stack staff 1628 Aug 9 20:21 bin/hbase-daemons.sh
bq. >
bq. > The passed 'args' are bad for standalone?
'conf/backup-masters' are not meant to be local instances, just like extra regionservers aren't. Hence bin/local-master-backup.sh & bin/local-regionserver.sh (trying to stay consistent). However, I didn't originally test this in local mode, only a cluster. Tested in local mode and got the same error. I ran 'chmod +x bin/master-backup.sh' and the problem went away. Let me know if you still have problems. Should run fine other than that.
I did notice that I need to place 'stop master-backup' inside the distributed conditional. Will fix on the next update.
bq. On 2010-08-09 20:33:12, stack wrote:
bq. > trunk/bin/master-backup.sh, line 64
bq. > <http://review.cloudera.org/r/592/diff/1/?file=6096#file6096line64>
bq. >
bq. > I don't understand this construct Nicolas (My shell scripting requires me to have a book or a web page open while I write -- currently its not present).
this performs string substitution on ${args} and changes 'master-backup' to 'master'. The remote command to call is 'hbase-daemon.sh start master --backup'. I'm changing to ${args/master-backup/master} for a little more clarity
- Nicolas
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://review.cloudera.org/r/592/#review793
-----------------------------------------------------------
> Add Backup CLI Option to HMaster
> --------------------------------
>
> Key: HBASE-2870
> URL: https://issues.apache.org/jira/browse/HBASE-2870
> Project: HBase
> Issue Type: New Feature
> Reporter: Nicolas Spiegelberg
> Assignee: Karthik Ranganathan
> Priority: Minor
> Fix For: 0.90.0
>
>
> The HMaster main() should allow a toggle like --backup, which forces it to be a secondary master on startup versus a primary candidate. That way, we can start up multiple masters at once and deterministically know which one will be the original primary.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (HBASE-2870) Add Backup CLI Option to HMaster
Posted by "stack (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
stack reassigned HBASE-2870:
----------------------------
Assignee: Nicolas Spiegelberg (was: Karthik Ranganathan)
> Add Backup CLI Option to HMaster
> --------------------------------
>
> Key: HBASE-2870
> URL: https://issues.apache.org/jira/browse/HBASE-2870
> Project: HBase
> Issue Type: New Feature
> Reporter: Nicolas Spiegelberg
> Assignee: Nicolas Spiegelberg
> Priority: Minor
> Fix For: 0.90.0
>
> Attachments: HBASE-2870-2.patch
>
>
> The HMaster main() should allow a toggle like --backup, which forces it to be a secondary master on startup versus a primary candidate. That way, we can start up multiple masters at once and deterministically know which one will be the original primary.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HBASE-2870) Add Backup CLI Option to HMaster
Posted by "HBase Review Board (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12896763#action_12896763 ]
HBase Review Board commented on HBASE-2870:
-------------------------------------------
Message from: stack@duboce.net
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://review.cloudera.org/r/592/#review793
-----------------------------------------------------------
I applied patch and built. On shutdown of a standalone instance I got this:
"pynchon-305:trunk stack$ ./bin/stop-hbase.sh
stopping hbase................../Users/stack/checkouts/trunk/bin/hbase-daemons.sh: line 49: /Users/stack/checkouts/trunk/bin/master-backup.sh: Permission denied
/Users/stack/checkouts/trunk/bin/hbase-daemons.sh: line 49: exec: /Users/stack/checkouts/trunk/bin/master-backup.sh: cannot execute: Unknown error: 0"
My script looks to have x perms:
pynchon-305:trunk stack$ ls -la bin/hbase-daemons.sh
-rwxr-xr-x 1 stack staff 1628 Aug 9 20:21 bin/hbase-daemons.sh
The passed 'args' are bad for standalone?
trunk/bin/master-backup.sh
<http://review.cloudera.org/r/592/#comment2668>
I don't understand this construct Nicolas (My shell scripting requires me to have a book or a web page open while I write -- currently its not present).
- stack
> Add Backup CLI Option to HMaster
> --------------------------------
>
> Key: HBASE-2870
> URL: https://issues.apache.org/jira/browse/HBASE-2870
> Project: HBase
> Issue Type: New Feature
> Reporter: Nicolas Spiegelberg
> Assignee: Karthik Ranganathan
> Priority: Minor
> Fix For: 0.90.0
>
>
> The HMaster main() should allow a toggle like --backup, which forces it to be a secondary master on startup versus a primary candidate. That way, we can start up multiple masters at once and deterministically know which one will be the original primary.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (HBASE-2870) Add Backup CLI Option to HMaster
Posted by "stack (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
stack resolved HBASE-2870.
--------------------------
Resolution: Fixed
Reresolving - - committed mend
> Add Backup CLI Option to HMaster
> --------------------------------
>
> Key: HBASE-2870
> URL: https://issues.apache.org/jira/browse/HBASE-2870
> Project: HBase
> Issue Type: New Feature
> Reporter: Nicolas Spiegelberg
> Assignee: Nicolas Spiegelberg
> Priority: Minor
> Fix For: 0.90.0
>
> Attachments: 2870-mend.txt, HBASE-2870-2.patch
>
>
> The HMaster main() should allow a toggle like --backup, which forces it to be a secondary master on startup versus a primary candidate. That way, we can start up multiple masters at once and deterministically know which one will be the original primary.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HBASE-2870) Add Backup CLI Option to HMaster
Posted by "Nicolas Spiegelberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12891783#action_12891783 ]
Nicolas Spiegelberg commented on HBASE-2870:
--------------------------------------------
Add option to GNU Parser in HMaster.doMain. Inside the HMaster constructor, extremely rough pseudo-code to explain what we should do
{quote}
if (backup) {
while (not zookeeper.hasZNode("/hbase/master") { sleep{10000) }
}
while ( zookeeper.setZNode("/hbase/master", this.address) != sucess) { sleep (10000) }
{quote}
So, the backup will wait for the primary to create the master ZNode before it begins it's polling loop. The assumption being that you will be monitoring your cluster during startup and will be waiting to observe primary HMaster startup.
> Add Backup CLI Option to HMaster
> --------------------------------
>
> Key: HBASE-2870
> URL: https://issues.apache.org/jira/browse/HBASE-2870
> Project: HBase
> Issue Type: New Feature
> Reporter: Nicolas Spiegelberg
> Assignee: Karthik Ranganathan
> Priority: Minor
> Fix For: 0.90.0
>
>
> The HMaster main() should allow a toggle like --backup, which forces it to be a secondary master on startup versus a primary candidate. That way, we can start up multiple masters at once and deterministically know which one will be the original primary.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.