Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
0.17.0
-
None
-
Fedora 9 Core Linux with openjdk-1.6.0
Hadoop 0.17.0
-
Reviewed
Description
I wanted to test out playing with the ec2 contributed shell scripts to kick off a Hadoop EC2 cluster however I found that without a set AWS_ACCOUNT_ID the script would still continue to run but not properly set the authorization groups due to the lack of an AWS Account ID parameter.
I have attached a quick patch to launch-hadoop-master to double check the existence of AWS_ACCOUNT_ID and abort the script as early as possible and present a useful error message to the user.
Below is the pach in cut and paste
— hadoop-0.17.0/src/contrib/ec2/bin/launch-hadoop-master 2008-05-15 16:20:14.000000000 +0900
+++ hadoop-0.17.0-modified/src/contrib/ec2/bin/launch-hadoop-master 2008-06-20 11:58:59.000000000 +0900
@@ -29,6 +29,12 @@
bin=`cd "$bin"; pwd`
. "$bin"/hadoop-ec2-env.sh
+if [ -z $AWS_ACCOUNT_ID ]; then
+ echo "AWS_ACCOUNT_ID is not configured properly! Please check"
+ echo "AWS_ACCOUNT_ID: $AWS_ACCOUNT_ID"
+ exit -1
+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=`echo "$MASTER_EC2_HOST" | awk '"INSTANCE" == $1 && "running" == $6
'`
@@ -108,4 +114,4 @@
ssh $SSH_OPTS "root@$MASTER_EC2_HOST" "chmod 600 /root/.ssh/id_rsa"
MASTER_IP=`dig +short $MASTER_EC2_HOST`
-echo "Master is $MASTER_EC2_HOST, ip is $MASTER_IP, zone is $MASTER_EC2_ZONE."
\ No newline at end of file
+echo "Master is $MASTER_EC2_HOST, ip is $MASTER_IP, zone is $MASTER_EC2_ZONE."