hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r881183 - /hadoop/hbase/trunk/src/contrib/ec2/bin/
Date Tue, 17 Nov 2009 08:00:25 GMT
Author: apurtell
Date: Tue Nov 17 08:00:24 2009
New Revision: 881183

URL: http://svn.apache.org/viewvc?rev=881183&view=rev
Log:
HBASE 1961 HBase EC2 scripts; pass private key and cert path on command line to all tools
in common variable

Modified:
    hadoop/hbase/trunk/src/contrib/ec2/bin/cmd-hbase-cluster
    hadoop/hbase/trunk/src/contrib/ec2/bin/create-hbase-image
    hadoop/hbase/trunk/src/contrib/ec2/bin/delete-hbase-cluster
    hadoop/hbase/trunk/src/contrib/ec2/bin/hbase-ec2-env.sh
    hadoop/hbase/trunk/src/contrib/ec2/bin/init-hbase-cluster-secgroups
    hadoop/hbase/trunk/src/contrib/ec2/bin/launch-hbase-master
    hadoop/hbase/trunk/src/contrib/ec2/bin/launch-hbase-slaves
    hadoop/hbase/trunk/src/contrib/ec2/bin/launch-hbase-zookeeper
    hadoop/hbase/trunk/src/contrib/ec2/bin/list-hbase-clusters
    hadoop/hbase/trunk/src/contrib/ec2/bin/revoke-hbase-cluster-secgroups
    hadoop/hbase/trunk/src/contrib/ec2/bin/terminate-hbase-cluster

Modified: hadoop/hbase/trunk/src/contrib/ec2/bin/cmd-hbase-cluster
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/contrib/ec2/bin/cmd-hbase-cluster?rev=881183&r1=881182&r2=881183&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/contrib/ec2/bin/cmd-hbase-cluster (original)
+++ hadoop/hbase/trunk/src/contrib/ec2/bin/cmd-hbase-cluster Tue Nov 17 08:00:24 2009
@@ -41,7 +41,7 @@
 . "$bin"/hbase-ec2-env.sh
 
 if [[ "$CLUSTER" = "i-*" ]]; then
-  HOST=`ec2-describe-instances $CLUSTER | grep running | awk '{print $4}'`
+  HOST=`ec2-describe-instances $TOOL_OPTS $CLUSTER | grep running | awk '{print $4}'`
   [ -z $HOST ] && echo "Instance still pending or no longer running: $CLUSTER" &&
exit 1
 else
   [ ! -f $MASTER_IP_PATH ] && echo "Wrong group name, or cluster not launched! $CLUSTER"
&& exit 1

Modified: hadoop/hbase/trunk/src/contrib/ec2/bin/create-hbase-image
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/contrib/ec2/bin/create-hbase-image?rev=881183&r1=881182&r2=881183&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/contrib/ec2/bin/create-hbase-image (original)
+++ hadoop/hbase/trunk/src/contrib/ec2/bin/create-hbase-image Tue Nov 17 08:00:24 2009
@@ -29,20 +29,20 @@
 echo "INSTANCE_TYPE is $INSTANCE_TYPE."
 echo "ARCH is $ARCH."
 
-AMI_IMAGE=`ec2-describe-images -a | grep $S3_BUCKET | grep hbase | grep $HBASE_VERSION |
grep $ARCH | grep available | awk '{print $2}'`
+AMI_IMAGE=`ec2-describe-images $TOOL_OPTS -a | grep $S3_BUCKET | grep hbase | grep $HBASE_VERSION
| grep $ARCH | grep available | awk '{print $2}'`
 
 [ ! -z $AMI_IMAGE ] && echo "AMI already registered, use: ec2-deregister $AMI_IMAGE"
&& exit 1
 
 echo "Starting a AMI with ID $BASE_AMI_IMAGE."
-OUTPUT=`ec2-run-instances $BASE_AMI_IMAGE -k $KEY_NAME -t $INSTANCE_TYPE`
+OUTPUT=`ec2-run-instances $BASE_AMI_IMAGE $TOOL_OPTS -k $KEY_NAME -t $INSTANCE_TYPE`
 BOOTING_INSTANCE=`echo $OUTPUT | awk '{print $6}'`
 
 echo "Instance is $BOOTING_INSTANCE."
 
-echo "Polling server status (ec2-describe-instances $BOOTING_INSTANCE)"
+echo "Polling server status"
 while true; do
   printf "."
-  HOSTNAME=`ec2-describe-instances $BOOTING_INSTANCE | grep running | awk '{print $4}'`
+  HOSTNAME=`ec2-describe-instances $TOOL_OPTS $BOOTING_INSTANCE | grep running | awk '{print
$4}'`
   if [ ! -z $HOSTNAME ]; then
     break;
   fi
@@ -72,6 +72,6 @@
 ssh $SSH_OPTS "root@$HOSTNAME" "sh -c \"INSTANCE_TYPE=$INSTANCE_TYPE /mnt/create-hbase-image-remote\""
 
 # Register image
-ec2-register $S3_BUCKET/hbase-$HBASE_VERSION-$ARCH.manifest.xml
+ec2-register $TOOL_OPTS $S3_BUCKET/hbase-$HBASE_VERSION-$ARCH.manifest.xml
 
 echo "Terminate with: ec2-terminate-instances $BOOTING_INSTANCE"

Modified: hadoop/hbase/trunk/src/contrib/ec2/bin/delete-hbase-cluster
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/contrib/ec2/bin/delete-hbase-cluster?rev=881183&r1=881182&r2=881183&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/contrib/ec2/bin/delete-hbase-cluster (original)
+++ hadoop/hbase/trunk/src/contrib/ec2/bin/delete-hbase-cluster Tue Nov 17 08:00:24 2009
@@ -24,8 +24,13 @@
 
 CLUSTER=$1
 
+# Import variables
+bin=`dirname "$0"`
+bin=`cd "$bin"; pwd`
+. "$bin"/hbase-ec2-env.sh
+
 # Finding HBase clusters
-CLUSTERS=`ec2-describe-instances | \
+CLUSTERS=`ec2-describe-instances $TOOL_OPTS | \
   awk '"RESERVATION" == $1 && $4 ~ /-master$/, "INSTANCE" == $1' | tr '\n' '\t' |
\
   grep "$CLUSTER" | grep running | cut -f4 | rev | cut -d'-' -f2- | rev`
   
@@ -34,11 +39,6 @@
   exit 0
 fi
 
-# Import variables
-bin=`dirname "$0"`
-bin=`cd "$bin"; pwd`
-. "$bin"/hbase-ec2-env.sh
-
 "$bin"/revoke-hbase-cluster-secgroups $CLUSTER
 
 rm -f $MASTER_IP_PATH

Modified: hadoop/hbase/trunk/src/contrib/ec2/bin/hbase-ec2-env.sh
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/contrib/ec2/bin/hbase-ec2-env.sh?rev=881183&r1=881182&r2=881183&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/contrib/ec2/bin/hbase-ec2-env.sh (original)
+++ hadoop/hbase/trunk/src/contrib/ec2/bin/hbase-ec2-env.sh Tue Nov 17 08:00:24 2009
@@ -45,6 +45,9 @@
 # SSH options used when connecting to EC2 instances.
 SSH_OPTS=`echo -q -i "$PRIVATE_KEY_PATH" -o StrictHostKeyChecking=no -o ServerAliveInterval=30`
 
+# Global tool options
+TOOL_OPTS=`echo -K "$EC2_PRIVATE_KEY" -C "$EC2_CERT"`
+
 # The version of HBase to use.
 HBASE_VERSION=0.20.1
 
@@ -55,8 +58,7 @@
 # The default value is for public images, so can be left if you are using running a public
image.
 # Change this value only if you are creating your own (private) AMI
 # so you can store it in a bucket you own.
-#S3_BUCKET=hbase-images
-S3_BUCKET=iridiant-bundles
+S3_BUCKET=hbase-images
 
 # Enable public access web interfaces
 # XXX -- Generally, you do not want to do this

Modified: hadoop/hbase/trunk/src/contrib/ec2/bin/init-hbase-cluster-secgroups
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/contrib/ec2/bin/init-hbase-cluster-secgroups?rev=881183&r1=881182&r2=881183&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/contrib/ec2/bin/init-hbase-cluster-secgroups (original)
+++ hadoop/hbase/trunk/src/contrib/ec2/bin/init-hbase-cluster-secgroups Tue Nov 17 08:00:24
2009
@@ -31,56 +31,56 @@
 
 echo "Creating/checking security groups"
 
-ec2-describe-group | egrep "[[:space:]]$CLUSTER_MASTER[[:space:]]" > /dev/null
+ec2-describe-group $TOOL_OPTS | egrep "[[:space:]]$CLUSTER_MASTER[[:space:]]" > /dev/null
 if [ ! $? -eq 0 ]; then
   echo "Creating group $CLUSTER_MASTER"
-  ec2-add-group $CLUSTER_MASTER -d "Group for HBase Master."
-  ec2-authorize $CLUSTER_MASTER -o $CLUSTER_MASTER -u $AWS_ACCOUNT_ID
-  ec2-authorize $CLUSTER_MASTER -p 22    # ssh
+  ec2-add-group $TOOL_OPTS $CLUSTER_MASTER -d "Group for HBase Master."
+  ec2-authorize $TOOL_OPTS $CLUSTER_MASTER -o $CLUSTER_MASTER -u $AWS_ACCOUNT_ID
+  ec2-authorize $TOOL_OPTS $CLUSTER_MASTER -p 22    # ssh
 
   if [ $ENABLE_WEB_PORTS = "true" ]; then
-    ec2-authorize $CLUSTER_MASTER -p 50070 # NameNode web interface
-    ec2-authorize $CLUSTER_MASTER -p 50075 # DataNode web interface
-    ec2-authorize $CLUSTER_MASTER -p 60010 # HBase master web interface
-    ec2-authorize $CLUSTER_MASTER -p 60030 # HBase region server web interface
+    ec2-authorize $TOOL_OPTS $CLUSTER_MASTER -p 50070 # NameNode web interface
+    ec2-authorize $TOOL_OPTS $CLUSTER_MASTER -p 50075 # DataNode web interface
+    ec2-authorize $TOOL_OPTS $CLUSTER_MASTER -p 60010 # HBase master web interface
+    ec2-authorize $TOOL_OPTS $CLUSTER_MASTER -p 60030 # HBase region server web interface
   fi
 else
   echo "Security group $CLUSTER_MASTER exists, ok"
 fi
 
-ec2-describe-group | egrep "[[:space:]]$CLUSTER[[:space:]]" > /dev/null
+ec2-describe-group $TOOL_OPTS | egrep "[[:space:]]$CLUSTER[[:space:]]" > /dev/null
 if [ ! $? -eq 0 ]; then
   echo "Creating group $CLUSTER"
-  ec2-add-group $CLUSTER -d "Group for HBase Slaves."
-  ec2-authorize $CLUSTER -o $CLUSTER -u $AWS_ACCOUNT_ID
-  ec2-authorize $CLUSTER -p 22    # ssh
+  ec2-add-group $TOOL_OPTS $CLUSTER -d "Group for HBase Slaves."
+  ec2-authorize $TOOL_OPTS $CLUSTER -o $CLUSTER -u $AWS_ACCOUNT_ID
+  ec2-authorize $TOOL_OPTS $CLUSTER -p 22    # ssh
 
   if [ $ENABLE_WEB_PORTS = "true" ]; then
-    ec2-authorize $CLUSTER -p 50070 # NameNode web interface
-    ec2-authorize $CLUSTER -p 50075 # DataNode web interface
-    ec2-authorize $CLUSTER -p 60010 # HBase master web interface
-    ec2-authorize $CLUSTER -p 60030 # HBase region server web interface
+    ec2-authorize $TOOL_OPTS $CLUSTER -p 50070 # NameNode web interface
+    ec2-authorize $TOOL_OPTS $CLUSTER -p 50075 # DataNode web interface
+    ec2-authorize $TOOL_OPTS $CLUSTER -p 60010 # HBase master web interface
+    ec2-authorize $TOOL_OPTS $CLUSTER -p 60030 # HBase region server web interface
   fi
 
-  ec2-authorize $CLUSTER_MASTER -o $CLUSTER -u $AWS_ACCOUNT_ID
-  ec2-authorize $CLUSTER -o $CLUSTER_MASTER -u $AWS_ACCOUNT_ID
+  ec2-authorize $TOOL_OPTS $CLUSTER_MASTER -o $CLUSTER -u $AWS_ACCOUNT_ID
+  ec2-authorize $TOOL_OPTS $CLUSTER -o $CLUSTER_MASTER -u $AWS_ACCOUNT_ID
 else
   echo "Security group $CLUSTER exists, ok"
 fi
 
 # Set up zookeeper group
 
-ec2-describe-group | egrep "[[:space:]]$CLUSTER_ZOOKEEPER[[:space:]]" > /dev/null
+ec2-describe-group $TOOL_OPTS | egrep "[[:space:]]$CLUSTER_ZOOKEEPER[[:space:]]" > /dev/null
 if [ ! $? -eq 0 ]; then
   echo "Creating group $CLUSTER_ZOOKEEPER"
-  ec2-add-group $CLUSTER_ZOOKEEPER -d "Group for HBase Zookeeper quorum."
-  ec2-authorize $CLUSTER_ZOOKEEPER -o $CLUSTER_ZOOKEEPER -u $AWS_ACCOUNT_ID
-  ec2-authorize $CLUSTER_ZOOKEEPER -p 22    # ssh
-
-  ec2-authorize $CLUSTER_MASTER -o $CLUSTER_ZOOKEEPER -u $AWS_ACCOUNT_ID
-  ec2-authorize $CLUSTER_ZOOKEEPER -o $CLUSTER_MASTER -u $AWS_ACCOUNT_ID
-  ec2-authorize $CLUSTER -o $CLUSTER_ZOOKEEPER -u $AWS_ACCOUNT_ID
-  ec2-authorize $CLUSTER_ZOOKEEPER -o $CLUSTER -u $AWS_ACCOUNT_ID
+  ec2-add-group $TOOL_OPTS $CLUSTER_ZOOKEEPER -d "Group for HBase Zookeeper quorum."
+  ec2-authorize $TOOL_OPTS $CLUSTER_ZOOKEEPER -o $CLUSTER_ZOOKEEPER -u $AWS_ACCOUNT_ID
+  ec2-authorize $TOOL_OPTS $CLUSTER_ZOOKEEPER -p 22    # ssh
+
+  ec2-authorize $TOOL_OPTS $CLUSTER_MASTER -o $CLUSTER_ZOOKEEPER -u $AWS_ACCOUNT_ID
+  ec2-authorize $TOOL_OPTS $CLUSTER_ZOOKEEPER -o $CLUSTER_MASTER -u $AWS_ACCOUNT_ID
+  ec2-authorize $TOOL_OPTS $CLUSTER -o $CLUSTER_ZOOKEEPER -u $AWS_ACCOUNT_ID
+  ec2-authorize $TOOL_OPTS $CLUSTER_ZOOKEEPER -o $CLUSTER -u $AWS_ACCOUNT_ID
 else
   echo "Security group $CLUSTER_ZOOKEEPER exists, ok"
 fi

Modified: hadoop/hbase/trunk/src/contrib/ec2/bin/launch-hbase-master
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/contrib/ec2/bin/launch-hbase-master?rev=881183&r1=881182&r2=881183&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/contrib/ec2/bin/launch-hbase-master (original)
+++ hadoop/hbase/trunk/src/contrib/ec2/bin/launch-hbase-master Tue Nov 17 08:00:24 2009
@@ -35,19 +35,19 @@
 fi
 
 echo "Testing for existing master in group: $CLUSTER"
-MASTER_EC2_HOST=`ec2-describe-instances | awk '"RESERVATION" == $1 && "'$CLUSTER_MASTER'"
== $4, "RESERVATION" == $1 && "'$CLUSTER_MASTER'" != $4'`
+MASTER_EC2_HOST=`ec2-describe-instances $TOOL_OPTS | awk '"RESERVATION" == $1 &&
"'$CLUSTER_MASTER'" == $4, "RESERVATION" == $1 && "'$CLUSTER_MASTER'" != $4'`
 MASTER_EC2_HOST=`echo "$MASTER_EC2_HOST" | awk '"INSTANCE" == $1 && "running" ==
$6 {print $4}'`
 
 if [ ! -z "$MASTER_EC2_HOST" ]; then
   echo "Master already running on: $MASTER_EC2_HOST"
-  MASTER_HOST=`ec2-describe-instances $INSTANCE | grep INSTANCE | grep running | grep $MASTER_EC2_HOST
| awk '{print $5}'`
+  MASTER_HOST=`ec2-describe-instances $TOOL_OPTS $INSTANCE | grep INSTANCE | grep running
| grep $MASTER_EC2_HOST | awk '{print $5}'`
   echo $MASTER_HOST > $MASTER_PRIVATE_IP_PATH
   echo $MASTER_EC2_HOST > $MASTER_IP_PATH
   exit 0
 fi
 
 # Finding HBase image
-[ -z "$AMI_IMAGE" ] && AMI_IMAGE=`ec2-describe-images -a | grep $S3_BUCKET | grep
$HBASE_VERSION | grep $ARCH | grep available | awk '{print $2}'`
+[ -z "$AMI_IMAGE" ] && AMI_IMAGE=`ec2-describe-images $TOOL_OPTS -a | grep $S3_BUCKET
| grep $HBASE_VERSION | grep $ARCH | grep available | awk '{print $2}'`
 
 # Start a master
 echo "Starting master with AMI $AMI_IMAGE (arch $ARCH)"
@@ -55,12 +55,12 @@
 ZOOKEEPER_QUORUM=`cat $ZOOKEEPER_QUORUM_PATH`
 sed -e "s|%ZOOKEEPER_QUORUM%|$ZOOKEEPER_QUORUM|" \
     "$bin"/$USER_DATA_FILE > "$bin"/$USER_DATA_FILE.master
-INSTANCE=`ec2-run-instances $AMI_IMAGE -n 1 -g $CLUSTER_MASTER -k $KEY_NAME -f "$bin"/$USER_DATA_FILE.master
-t $INSTANCE_TYPE | grep INSTANCE | awk '{print $2}'`
+INSTANCE=`ec2-run-instances $AMI_IMAGE $TOOL_OPTS -n 1 -g $CLUSTER_MASTER -k $KEY_NAME -f
"$bin"/$USER_DATA_FILE.master -t $INSTANCE_TYPE | grep INSTANCE | awk '{print $2}'`
 echo -n "Waiting for instance $INSTANCE to start"
 while true; do
   printf "."
   # get private dns
-  MASTER_HOST=`ec2-describe-instances $INSTANCE | grep running | awk '{print $5}'`
+  MASTER_HOST=`ec2-describe-instances $TOOL_OPTS $INSTANCE | grep running | awk '{print $5}'`
   if [ ! -z $MASTER_HOST ]; then
     echo " Started as $MASTER_HOST"
     break;
@@ -69,10 +69,10 @@
 done
 rm -f "$bin"/$USER_DATA_FILE.master
 
-MASTER_EC2_HOST=`ec2-describe-instances $INSTANCE | grep INSTANCE | grep running | grep $MASTER_HOST
| awk '{print $4}'`
+MASTER_EC2_HOST=`ec2-describe-instances $TOOL_OPTS $INSTANCE | grep INSTANCE | grep running
| grep $MASTER_HOST | awk '{print $4}'`
 echo $MASTER_HOST > $MASTER_PRIVATE_IP_PATH
 echo $MASTER_EC2_HOST > $MASTER_IP_PATH
-MASTER_EC2_ZONE=`ec2-describe-instances $INSTANCE | grep INSTANCE | grep running | grep $MASTER_HOST
| awk '{print $11}'`
+MASTER_EC2_ZONE=`ec2-describe-instances $TOOL_OPTS $INSTANCE | grep INSTANCE | grep running
| grep $MASTER_HOST | awk '{print $11}'`
 echo $MASTER_EC2_ZONE > $MASTER_ZONE_PATH
 
 while true; do

Modified: hadoop/hbase/trunk/src/contrib/ec2/bin/launch-hbase-slaves
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/contrib/ec2/bin/launch-hbase-slaves?rev=881183&r1=881182&r2=881183&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/contrib/ec2/bin/launch-hbase-slaves (original)
+++ hadoop/hbase/trunk/src/contrib/ec2/bin/launch-hbase-slaves Tue Nov 17 08:00:24 2009
@@ -41,7 +41,7 @@
   exit 1
 fi
 
-[ -z "$AMI_IMAGE" ] && AMI_IMAGE=`ec2-describe-images -a | grep $S3_BUCKET | grep
$HBASE_VERSION | grep $ARCH |grep available | awk '{print $2}'`
+[ -z "$AMI_IMAGE" ] && AMI_IMAGE=`ec2-describe-images $TOOL_OPTS -a | grep $S3_BUCKET
| grep $HBASE_VERSION | grep $ARCH |grep available | awk '{print $2}'`
 
 MASTER_HOST=`cat $MASTER_PRIVATE_IP_PATH`
 MASTER_ZONE=`cat $MASTER_ZONE_PATH`
@@ -54,6 +54,6 @@
 
 # Start slaves
 echo "Starting $NO_INSTANCES AMI(s) with ID $AMI_IMAGE (arch $ARCH) in group $CLUSTER in
zone $MASTER_ZONE"
-ec2-run-instances $AMI_IMAGE -n "$NO_INSTANCES" -g "$CLUSTER" -k "$KEY_NAME" -f "$bin"/$USER_DATA_FILE.slave
-t "$INSTANCE_TYPE" -z "$MASTER_ZONE" | grep INSTANCE | awk '{print $2}'
+ec2-run-instances $AMI_IMAGE $TOOL_OPTS -n "$NO_INSTANCES" -g "$CLUSTER" -k "$KEY_NAME" -f
"$bin"/$USER_DATA_FILE.slave -t "$INSTANCE_TYPE" -z "$MASTER_ZONE" | grep INSTANCE | awk '{print
$2}'
 
 rm "$bin"/$USER_DATA_FILE.slave

Modified: hadoop/hbase/trunk/src/contrib/ec2/bin/launch-hbase-zookeeper
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/contrib/ec2/bin/launch-hbase-zookeeper?rev=881183&r1=881182&r2=881183&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/contrib/ec2/bin/launch-hbase-zookeeper (original)
+++ hadoop/hbase/trunk/src/contrib/ec2/bin/launch-hbase-zookeeper Tue Nov 17 08:00:24 2009
@@ -41,7 +41,7 @@
 [ -z "$arch" ] && arch=$ARCH
 
 # Finding HBase image
-[ -z "$ZOO_AMI_IMAGE" ] && ZOO_AMI_IMAGE=`ec2-describe-images -a | grep $S3_BUCKET
| grep hbase | grep $HBASE_VERSION | grep $arch |grep available | awk '{print $2}'`
+[ -z "$ZOO_AMI_IMAGE" ] && ZOO_AMI_IMAGE=`ec2-describe-images $TOOL_OPTS -a | grep
$S3_BUCKET | grep hbase | grep $HBASE_VERSION | grep $arch |grep available | awk '{print $2}'`
 
 # Start Zookeeper instances
 
@@ -51,12 +51,12 @@
 public_names=""
 for inst in `seq 1 $NO_INSTANCES` ; do 
   echo "Starting an AMI with ID $ZOO_AMI_IMAGE (arch $arch) in group $CLUSTER_ZOOKEEPER"
-  INSTANCE=`ec2-run-instances $ZOO_AMI_IMAGE -n 1 -g $CLUSTER_ZOOKEEPER -k ${KEY_NAME} -t
$type | grep INSTANCE | awk '{print $2}'`
+  INSTANCE=`ec2-run-instances $ZOO_AMI_IMAGE $TOOL_OPTS -n 1 -g $CLUSTER_ZOOKEEPER -k ${KEY_NAME}
-t $type | grep INSTANCE | awk '{print $2}'`
   echo -n "Waiting for instance $INSTANCE to start: "
   while true; do
     printf "."
     # get private dns
-    priv=`ec2-describe-instances $INSTANCE | grep running | awk '{print $5}'`
+    priv=`ec2-describe-instances $TOOL_OPTS $INSTANCE | grep running | awk '{print $5}'`
     if [ ! -z $priv ]; then
       echo " Started ZooKeeper instance $INSTANCE as ${priv}"
       break
@@ -64,7 +64,7 @@
     sleep 1
   done
   peers="$peers $priv"
-  public=`ec2-describe-instances $INSTANCE | grep running | awk '{print $4}'`
+  public=`ec2-describe-instances $TOOL_OPTS $INSTANCE | grep running | awk '{print $4}'`
   echo "    Public DNS name is $public."
   public_names="$public_names $public"
 done

Modified: hadoop/hbase/trunk/src/contrib/ec2/bin/list-hbase-clusters
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/contrib/ec2/bin/list-hbase-clusters?rev=881183&r1=881182&r2=881183&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/contrib/ec2/bin/list-hbase-clusters (original)
+++ hadoop/hbase/trunk/src/contrib/ec2/bin/list-hbase-clusters Tue Nov 17 08:00:24 2009
@@ -23,7 +23,7 @@
 . "$bin"/hbase-ec2-env.sh
 
 # Finding HBase clusters
-CLUSTERS=`ec2-describe-instances | awk '"RESERVATION" == $1 && $4 ~ /-master$/, "INSTANCE"
== $1' | tr '\n' '\t' | grep running | cut -f4 | rev | cut -d'-' -f2- | rev`
+CLUSTERS=`ec2-describe-instances $TOOL_OPTS | awk '"RESERVATION" == $1 && $4 ~ /-master$/,
"INSTANCE" == $1' | tr '\n' '\t' | grep running | cut -f4 | rev | cut -d'-' -f2- | rev`
 
 [ -z "$CLUSTERS" ] && echo "No running clusters." && exit 0
 

Modified: hadoop/hbase/trunk/src/contrib/ec2/bin/revoke-hbase-cluster-secgroups
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/contrib/ec2/bin/revoke-hbase-cluster-secgroups?rev=881183&r1=881182&r2=881183&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/contrib/ec2/bin/revoke-hbase-cluster-secgroups (original)
+++ hadoop/hbase/trunk/src/contrib/ec2/bin/revoke-hbase-cluster-secgroups Tue Nov 17 08:00:24
2009
@@ -31,38 +31,38 @@
 
 echo "Revoking security groups"
 
-ec2-describe-group | egrep "[[:space:]]$CLUSTER_MASTER[[:space:]]" > /dev/null
+ec2-describe-group $TOOL_OPTS | egrep "[[:space:]]$CLUSTER_MASTER[[:space:]]" > /dev/null
 if [ $? -eq 0 ]; then
-  ec2-revoke $CLUSTER_MASTER -o $CLUSTER_MASTER -u $AWS_ACCOUNT_ID
+  ec2-revoke $TOOL_OPTS $CLUSTER_MASTER -o $CLUSTER_MASTER -u $AWS_ACCOUNT_ID
 fi
 
 ec2-describe-group | egrep "[[:space:]]$CLUSTER[[:space:]]" > /dev/null
 if [ $? -eq 0 ]; then
-  ec2-revoke $CLUSTER -o $CLUSTER -u $AWS_ACCOUNT_ID
-  ec2-revoke $CLUSTER_MASTER -o $CLUSTER -u $AWS_ACCOUNT_ID
-  ec2-revoke $CLUSTER -o $CLUSTER_MASTER -u $AWS_ACCOUNT_ID
+  ec2-revoke $TOOL_OPTS $CLUSTER -o $CLUSTER -u $AWS_ACCOUNT_ID
+  ec2-revoke $TOOL_OPTS $CLUSTER_MASTER -o $CLUSTER -u $AWS_ACCOUNT_ID
+  ec2-revoke $TOOL_OPTS $CLUSTER -o $CLUSTER_MASTER -u $AWS_ACCOUNT_ID
 fi
 
 ec2-describe-group | egrep "[[:space:]]$CLUSTER_ZOOKEEPER[[:space:]]" > /dev/null
 if [  $? -eq 0 ]; then
-  ec2-revoke $CLUSTER_ZOOKEEPER -o $CLUSTER_ZOOKEEPER -u $AWS_ACCOUNT_ID
-  ec2-revoke $CLUSTER_MASTER -o $CLUSTER_ZOOKEEPER -u $AWS_ACCOUNT_ID
-  ec2-revoke $CLUSTER_ZOOKEEPER -o $CLUSTER_MASTER -u $AWS_ACCOUNT_ID
-  ec2-revoke $CLUSTER -o $CLUSTER_ZOOKEEPER -u $AWS_ACCOUNT_ID
-  ec2-revoke $CLUSTER_ZOOKEEPER -o $CLUSTER -u $AWS_ACCOUNT_ID
+  ec2-revoke $TOOL_OPTS $CLUSTER_ZOOKEEPER -o $CLUSTER_ZOOKEEPER -u $AWS_ACCOUNT_ID
+  ec2-revoke $TOOL_OPTS $CLUSTER_MASTER -o $CLUSTER_ZOOKEEPER -u $AWS_ACCOUNT_ID
+  ec2-revoke $TOOL_OPTS $CLUSTER_ZOOKEEPER -o $CLUSTER_MASTER -u $AWS_ACCOUNT_ID
+  ec2-revoke $TOOL_OPTS $CLUSTER -o $CLUSTER_ZOOKEEPER -u $AWS_ACCOUNT_ID
+  ec2-revoke $TOOL_OPTS $CLUSTER_ZOOKEEPER -o $CLUSTER -u $AWS_ACCOUNT_ID
 fi
 
-ec2-describe-group | egrep "[[:space:]]$CLUSTER_MASTER[[:space:]]" > /dev/null
+ec2-describe-group $TOOL_OPTS | egrep "[[:space:]]$CLUSTER_MASTER[[:space:]]" > /dev/null
 if [ $? -eq 0 ]; then
-  ec2-delete-group $CLUSTER_MASTER
+  ec2-delete-group $TOOL_OPTS $CLUSTER_MASTER
 fi
 
-ec2-describe-group | egrep "[[:space:]]$CLUSTER_ZOOKEEPER[[:space:]]" > /dev/null
+ec2-describe-group $TOOL_OPTS | egrep "[[:space:]]$CLUSTER_ZOOKEEPER[[:space:]]" > /dev/null
 if [  $? -eq 0 ]; then
-  ec2-delete-group $CLUSTER_ZOOKEEPER
+  ec2-delete-group $TOOL_OPTS $CLUSTER_ZOOKEEPER
 fi
 
-ec2-describe-group | egrep "[[:space:]]$CLUSTER[[:space:]]" > /dev/null
+ec2-describe-group $TOOL_OPTS | egrep "[[:space:]]$CLUSTER[[:space:]]" > /dev/null
 if [  $? -eq 0 ]; then
-  ec2-delete-group $CLUSTER
+  ec2-delete-group $TOOL_OPTS $CLUSTER
 fi

Modified: hadoop/hbase/trunk/src/contrib/ec2/bin/terminate-hbase-cluster
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/contrib/ec2/bin/terminate-hbase-cluster?rev=881183&r1=881182&r2=881183&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/contrib/ec2/bin/terminate-hbase-cluster (original)
+++ hadoop/hbase/trunk/src/contrib/ec2/bin/terminate-hbase-cluster Tue Nov 17 08:00:24 2009
@@ -30,7 +30,7 @@
 . "$bin"/hbase-ec2-env.sh
 
 # Finding HBase image
-HBASE_INSTANCES=`ec2-describe-instances | awk '"RESERVATION" == $1 && ("'$CLUSTER'"
== $4 || "'$CLUSTER_MASTER'" == $4 || "'$CLUSTER_ZOOKEEPER'" == $4), "RESERVATION" == $1 &&
("'$CLUSTER'" != $4 && "'$CLUSTER_MASTER'" != $4 && "'$CLUSTER_ZOOKEEPER'"
!= $4)'`
+HBASE_INSTANCES=`ec2-describe-instances $TOOL_OPTS | awk '"RESERVATION" == $1 &&
("'$CLUSTER'" == $4 || "'$CLUSTER_MASTER'" == $4 || "'$CLUSTER_ZOOKEEPER'" == $4), "RESERVATION"
== $1 && ("'$CLUSTER'" != $4 && "'$CLUSTER_MASTER'" != $4 && "'$CLUSTER_ZOOKEEPER'"
!= $4)'`
 HBASE_INSTANCES=`echo "$HBASE_INSTANCES" | grep INSTANCE | grep running`
 
 [ -z "$HBASE_INSTANCES" ] && echo "No running instances in cluster $CLUSTER." &&
exit 0
@@ -43,4 +43,4 @@
   exit 1
 fi
 
-ec2-terminate-instances `echo "$HBASE_INSTANCES" | awk '{print $2}'`
+ec2-terminate-instances $TOOL_OPTS `echo "$HBASE_INSTANCES" | awk '{print $2}'`



Mime
View raw message