1 | # Set environment variables for running Hadoop on Amazon EC2 here. All are required. |
---|
2 | |
---|
3 | # Licensed to the Apache Software Foundation (ASF) under one or more |
---|
4 | # contributor license agreements. See the NOTICE file distributed with |
---|
5 | # this work for additional information regarding copyright ownership. |
---|
6 | # The ASF licenses this file to You under the Apache License, Version 2.0 |
---|
7 | # (the "License"); you may not use this file except in compliance with |
---|
8 | # the License. You may obtain a copy of the License at |
---|
9 | # |
---|
10 | # http://www.apache.org/licenses/LICENSE-2.0 |
---|
11 | # |
---|
12 | # Unless required by applicable law or agreed to in writing, software |
---|
13 | # distributed under the License is distributed on an "AS IS" BASIS, |
---|
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
15 | # See the License for the specific language governing permissions and |
---|
16 | # limitations under the License. |
---|
17 | |
---|
18 | # Your Amazon Account Number. |
---|
19 | AWS_ACCOUNT_ID= |
---|
20 | |
---|
21 | # Your Amazon AWS access key. |
---|
22 | AWS_ACCESS_KEY_ID= |
---|
23 | |
---|
24 | # Your Amazon AWS secret access key. |
---|
25 | AWS_SECRET_ACCESS_KEY= |
---|
26 | |
---|
27 | # Location of EC2 keys. |
---|
28 | # The default setting is probably OK if you set up EC2 following the Amazon Getting Started guide. |
---|
29 | EC2_KEYDIR=`dirname "$EC2_PRIVATE_KEY"` |
---|
30 | |
---|
31 | # The EC2 key name used to launch instances. |
---|
32 | # The default is the value used in the Amazon Getting Started guide. |
---|
33 | KEY_NAME=gsg-keypair |
---|
34 | |
---|
35 | # Where your EC2 private key is stored (created when following the Amazon Getting Started guide). |
---|
36 | # You need to change this if you don't store this with your other EC2 keys. |
---|
37 | PRIVATE_KEY_PATH=`echo "$EC2_KEYDIR"/"id_rsa-$KEY_NAME"` |
---|
38 | |
---|
39 | # SSH options used when connecting to EC2 instances. |
---|
40 | SSH_OPTS=`echo -i "$PRIVATE_KEY_PATH" -o StrictHostKeyChecking=no -o ServerAliveInterval=30` |
---|
41 | |
---|
42 | # The version of Hadoop to use. |
---|
43 | HADOOP_VERSION=0.19.0 |
---|
44 | |
---|
45 | # The Amazon S3 bucket where the Hadoop AMI is stored. |
---|
46 | # The default value is for public images, so can be left if you are using running a public image. |
---|
47 | # Change this value only if you are creating your own (private) AMI |
---|
48 | # so you can store it in a bucket you own. |
---|
49 | S3_BUCKET=hadoop-images |
---|
50 | |
---|
51 | # Enable public access to JobTracker and TaskTracker web interfaces |
---|
52 | ENABLE_WEB_PORTS=true |
---|
53 | |
---|
54 | # The script to run on instance boot. |
---|
55 | USER_DATA_FILE=hadoop-ec2-init-remote.sh |
---|
56 | |
---|
57 | # The EC2 instance type: m1.small, m1.large, m1.xlarge |
---|
58 | INSTANCE_TYPE="m1.small" |
---|
59 | #INSTANCE_TYPE="m1.large" |
---|
60 | #INSTANCE_TYPE="m1.xlarge" |
---|
61 | #INSTANCE_TYPE="c1.medium" |
---|
62 | #INSTANCE_TYPE="c1.xlarge" |
---|
63 | |
---|
64 | # The EC2 group master name. CLUSTER is set by calling scripts |
---|
65 | CLUSTER_MASTER=$CLUSTER-master |
---|
66 | |
---|
67 | # Cached values for a given cluster |
---|
68 | MASTER_PRIVATE_IP_PATH=~/.hadooop-private-$CLUSTER_MASTER |
---|
69 | MASTER_IP_PATH=~/.hadooop-$CLUSTER_MASTER |
---|
70 | MASTER_ZONE_PATH=~/.hadooop-zone-$CLUSTER_MASTER |
---|
71 | |
---|
72 | # |
---|
73 | # The following variables are only used when creating an AMI. |
---|
74 | # |
---|
75 | |
---|
76 | # The version number of the installed JDK. |
---|
77 | JAVA_VERSION=1.6.0_07 |
---|
78 | |
---|
79 | # SUPPORTED_ARCHITECTURES = ['i386', 'x86_64'] |
---|
80 | # The download URL for the Sun JDK. Visit http://java.sun.com/javase/downloads/index.jsp and get the URL for the "Linux self-extracting file". |
---|
81 | if [ "$INSTANCE_TYPE" == "m1.small" -o "$INSTANCE_TYPE" == "c1.medium" ]; then |
---|
82 | ARCH='i386' |
---|
83 | BASE_AMI_IMAGE="ami-2b5fba42" # ec2-public-images/fedora-8-i386-base-v1.07.manifest.xml |
---|
84 | JAVA_BINARY_URL='' |
---|
85 | else |
---|
86 | ARCH='x86_64' |
---|
87 | BASE_AMI_IMAGE="ami-2a5fba43" # ec2-public-images/fedora-8-x86_64-base-v1.07.manifest.xml |
---|
88 | JAVA_BINARY_URL='' |
---|
89 | fi |
---|
90 | |
---|
91 | if [ "$INSTANCE_TYPE" == "c1.medium" ]; then |
---|
92 | AMI_KERNEL=aki-9b00e5f2 # ec2-public-images/vmlinuz-2.6.18-xenU-ec2-v1.0.i386.aki.manifest.xml |
---|
93 | fi |
---|
94 | |
---|
95 | if [ "$INSTANCE_TYPE" == "c1.xlarge" ]; then |
---|
96 | AMI_KERNEL=aki-9800e5f1 # ec2-public-images/vmlinuz-2.6.18-xenU-ec2-v1.0.x86_64.aki.manifest.xml |
---|
97 | fi |
---|
98 | |
---|
99 | if [ "$AMI_KERNEL" != "" ]; then |
---|
100 | KERNEL_ARG="--kernel ${AMI_KERNEL}" |
---|
101 | fi |
---|