Repository navigation
Expand file tree
/
Copy pathcreate-stack.sh
More file actions
executable file
·50 lines (46 loc) · 2.72 KB
/
Copy pathcreate-stack.sh
File metadata and controls
executable file
·50 lines (46 loc) · 2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Usage: ./create-stack.sh 2 5G m3.large 5G brent-keys2 50 1 20 8 50 500 true 20 true true
set +x
UUID='unknown'
unamestr=`uname`
if [[ "$unamestr" == "Darwin" ]]; then
UUID=$(uuidgen | tr 'A-Z' 'a-z' | egrep -o "[a-zA-Z][-a-zA-Z0-9]*")
else
UUID=$(cat /proc/sys/kernel/random/uuid | egrep -o "[a-zA-Z][-a-zA-Z0-9]*")
fi
echo ParameterKey=BrokerCapacity,ParameterValue=$1 # Number of servers to spin up as Spark workers / Kudu tablets
echo ParameterKey=WorkerMem,ParameterValue=$2 # Overall amount of memory each worker should allocate (should be system memory / 2 to save room for kudu)
echo ParameterKey=InstanceType,ParameterValue=$3 # m3.medium, m3.2xlarge, etc https://aws.amazon.com/ec2/pricing/
echo ParameterKey=ExecMem,ParameterValue=$4 # Memory Spark should allocate for each executor (there can be multiple executors active on a worker - should be equal to WorkerMem)
echo ParameterKey=KeyName,ParameterValue=$5 # AWS secret key name
echo ParameterKey=DataVolumeSize,ParameterValue=$6
echo ParameterKey=ScaleFactor,ParameterValue=$7 # TPC-H scale factor 1=1GB, 10=10GB, etc
echo ParameterKey=PartitionCount,ParameterValue=$8 # Default partition count for Spark
echo ParameterKey=BenchmarkUsers,ParameterValue=$9 # How many simultaneous users to simulate
echo ParameterKey=WalVolumeSize,ParameterValue=${10}
echo ParameterKey=IOPS,ParameterValue=${11} # Supposedly this should be <= disk size * 30, but > 1000 never reliably seems to work
echo ParameterKey=PowerOnly,ParameterValue=${12} # if "true" then run only the power test, which is fast
echo ParameterKey=KuduPartitionCount,ParameterValue=${13} # From what the kudu team says, it sounds like this should be servers * 10
echo ParameterKey=SkipRF,ParameterValue=${14} # if "true" skip the RF test
echo ParameterKey=Direct,ParameterValue=${15} # Populate directly from S3
echo StackID=$UUID
aws cloudformation create-stack \
--capabilities CAPABILITY_IAM \
--stack-name $UUID \
--template-body file://cloud-formation.json \
--parameters \
ParameterKey=KeyName,ParameterValue=$5 \
ParameterKey=BrokerCapacity,ParameterValue=$1 \
ParameterKey=InstanceType,ParameterValue=$3 \
ParameterKey=WorkerMem,ParameterValue=$2 \
ParameterKey=ExecMem,ParameterValue=$4 \
ParameterKey=DataVolumeSize,ParameterValue=$6 \
ParameterKey=ScaleFactor,ParameterValue=$7 \
ParameterKey=PartitionCount,ParameterValue=$8 \
ParameterKey=BenchmarkUsers,ParameterValue=$9 \
ParameterKey=WalVolumeSize,ParameterValue=${10} \
ParameterKey=IOPS,ParameterValue=${11} \
ParameterKey=PowerOnly,ParameterValue=${12} \
ParameterKey=KuduPartitionCount,ParameterValue=${13} \
ParameterKey=SkipRF,ParameterValue=${14} \
ParameterKey=Direct,ParameterValue=${15}
UUID=$UUID ./poll.sh