From 89a5eb519a64c8d4ee3e58b400fee8e4956ab644 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Fri, 22 Oct 2010 23:47:24 +0000 Subject: [PATCH] HBASE-2998 rolling-restart.sh shouldn't rely on zoo.cfg; some improvements to the rr script -- reapply rolling-restart.bin improvments git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1026532 13f79535-47bb-0310-9956-ffa450edef68 --- bin/rolling-restart.sh | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/bin/rolling-restart.sh b/bin/rolling-restart.sh index 123ab1ec3d6..ae7a9be02a5 100755 --- a/bin/rolling-restart.sh +++ b/bin/rolling-restart.sh @@ -64,7 +64,7 @@ else zmaster=`$bin/hbase org.apache.hadoop.hbase.util.HBaseConfTool zookeeper.znode.master` if [ "$zmaster" == "null" ]; then zmaster="master"; fi zmaster=$zparent/$zmaster - echo -n "Waiting for Master ZNode to expire" + echo -n "Waiting for Master ZNode ${zmaster} to expire" while bin/hbase zkcli stat $zmaster >/dev/null 2>&1; do echo -n "." sleep 1 @@ -76,6 +76,27 @@ else "$bin"/hbase-daemons.sh --config "${HBASE_CONF_DIR}" \ --hosts "${HBASE_BACKUP_MASTERS}" start master-backup + echo "Wait a minute for master to come up join cluster" + sleep 60 + + # Master joing cluster will start in cleaning out regions in transition. + # Wait until the master has cleaned out regions in transition before + # giving it a bunch of work to do; master is vulnerable during startup + zunassigned=`$bin/hbase org.apache.hadoop.hbase.util.HBaseConfTool zookeeper.znode.unassigned` + if [ "$zunassigned" == "null" ]; then zunassigned="unassigned"; fi + zunassigned="$zparent/$zunassigned" + echo -n "Waiting for ${zunassigned} to empty" + while true ; do + unassigned=`$bin/hbase zkcli stat ${zunassigned} 2>&1 |grep -e 'numChildren = '|sed -e 's,numChildren = ,,'` + if test 0 -eq ${unassigned} + then + break + else + echo -n " ${unassigned}" + fi + sleep 1 + done + # unlike the masters, roll all regionservers one-at-a-time export HBASE_SLAVE_PARALLEL=false "$bin"/hbase-daemons.sh --config "${HBASE_CONF_DIR}" \