hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1026532 - /hbase/trunk/bin/rolling-restart.sh
Date Fri, 22 Oct 2010 23:47:24 GMT
Author: stack
Date: Fri Oct 22 23:47:24 2010
New Revision: 1026532

URL: http://svn.apache.org/viewvc?rev=1026532&view=rev
Log:
HBASE-2998 rolling-restart.sh shouldn't rely on zoo.cfg; some improvements to the rr script
-- reapply rolling-restart.bin improvments

Modified:
    hbase/trunk/bin/rolling-restart.sh

Modified: hbase/trunk/bin/rolling-restart.sh
URL: http://svn.apache.org/viewvc/hbase/trunk/bin/rolling-restart.sh?rev=1026532&r1=1026531&r2=1026532&view=diff
==============================================================================
--- hbase/trunk/bin/rolling-restart.sh (original)
+++ hbase/trunk/bin/rolling-restart.sh Fri Oct 22 23:47:24 2010
@@ -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}" \



Mime
View raw message