hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1089667 - in /hbase/branches/0.90: CHANGES.txt bin/graceful_stop.sh
Date Wed, 06 Apr 2011 23:14:40 GMT
Author: stack
Date: Wed Apr  6 23:14:40 2011
New Revision: 1089667

URL: http://svn.apache.org/viewvc?rev=1089667&view=rev
Log:
HBASE-3748 Add rolling of thrift/rest daemons to graceful_stop.sh script

Modified:
    hbase/branches/0.90/CHANGES.txt
    hbase/branches/0.90/bin/graceful_stop.sh

Modified: hbase/branches/0.90/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1089667&r1=1089666&r2=1089667&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Wed Apr  6 23:14:40 2011
@@ -10,6 +10,9 @@ Release 0.90.3 - Unreleased
    HBASE-3717  deprecate HTable isTableEnabled() methods in favor of HBaseAdmin
                methods (David Butler via Stack)
 
+  TASK
+   HBASE-3748  Add rolling of thrift/rest daemons to graceful_stop.sh script
+
 Release 0.90.2 - Unreleased
   BUG FIXES
    HBASE-3545  Possible liveness issue with MasterServerAddress in

Modified: hbase/branches/0.90/bin/graceful_stop.sh
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/bin/graceful_stop.sh?rev=1089667&r1=1089666&r2=1089667&view=diff
==============================================================================
--- hbase/branches/0.90/bin/graceful_stop.sh (original)
+++ hbase/branches/0.90/bin/graceful_stop.sh Wed Apr  6 23:14:40 2011
@@ -23,7 +23,9 @@
 # Move regions off a server then stop it.  Optionally restart and reload.
 # Turn off the balancer before running this script.
 function usage {
-  echo "Usage: graceful_stop.sh [--config <conf-dir>] [--restart] [--reload] <hostname>"

+  echo "Usage: graceful_stop.sh [--config <conf-dir>] [--restart] [--reload] [--thrift]
[--rest] <hostname>" 
+  echo " thrift      If we should stop/start thrift before/after the hbase stop/start"
+  echo " rest        If we should stop/start rest before/after the hbase stop/start"
   echo " restart     If we should restart after graceful stop"
   echo " reload      Move offloaded regions back on to the stopped server"
   echo " debug       Move offloaded regions back on to the stopped server"
@@ -43,9 +45,13 @@ bin=`cd "$bin">/dev/null; pwd`
 restart=
 reload=
 debug=
+thrift=
+rest=
 while [ $# -gt 0 ]
 do
   case "$1" in
+    --thrift)  thrift=true; shift;;
+    --rest)  rest=true; shift;;
     --restart)  restart=true; shift;;
     --reload)   reload=true; shift;;
     --debug)    debug="--debug"; shift;;
@@ -69,9 +75,22 @@ echo "Unloaded $hostname region(s)"
 # Stop the server. Have to put hostname into its own little file for hbase-daemons.sh
 hosts="/tmp/$(basename $0).$$.tmp"
 echo $hostname >> $hosts
+if [ "$thrift" != "" ]; then
+  "$bin"/hbase-daemons.sh --hosts ${hosts} stop thrift
+fi
+if [ "$rest" != "" ]; then
+  "$bin"/hbase-daemons.sh --hosts ${hosts} stop rest
+fi
 "$bin"/hbase-daemons.sh --hosts ${hosts} stop regionserver
 if [ "$restart" != "" ]; then
   "$bin"/hbase-daemons.sh --hosts ${hosts} start regionserver
+  if [ "$thrift" != "" ]; then
+    # -b 0.0.0.0 says listen on all interfaces rather than just default.
+    "$bin"/hbase-daemons.sh --hosts ${hosts} start thrift -b 0.0.0.0
+  fi
+  if [ "$rest" != "" ]; then
+    "$bin"/hbase-daemons.sh --hosts ${hosts} start rest
+  fi
   if [ "$reload" != "" ]; then
     echo "Reloading $hostname region(s)"
     HBASE_NOEXEC=true "$bin"/hbase org.jruby.Main "$bin"/region_mover.rb --file=$filename
$debug load $hostname



Mime
View raw message