Skip to content
This repository was archived by the owner on Nov 23, 2017. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
93c0365
command to start cluster with elastic ip association
Aug 25, 2016
3728896
command to create a cluster without setting it up
Aug 31, 2016
c25a323
cleaned up master elastic ip setup
Aug 31, 2016
18788e1
added option to ignore setup sequence with launch and start commands
Aug 31, 2016
d99e616
added a separate setup action with part functionality for ubuntu
Sep 1, 2016
b6279ee
adding ubuntu master deploy template for ec2 variables
Sep 1, 2016
f216cf5
partially adapted setup.sh for ubuntu
Sep 1, 2016
001ae23
more of setup.sh for ubuntu
Sep 1, 2016
694039d
setup-slave.sh for ubuntu
Sep 1, 2016
2d6cbcd
pssh command tweak for ubuntu
Sep 1, 2016
589bffa
pssh command tweak for ubuntu
Sep 1, 2016
17db3e4
minor fixes in setup.sh for ubuntu
Sep 1, 2016
110a705
more tweaks for master setup.sh
Sep 1, 2016
33d9ee8
minor ubuntu setup tweaks
Sep 2, 2016
0b2fffa
minor ubuntu setup tweaks
Sep 2, 2016
0817e4b
slave setup log dirs
Sep 2, 2016
5db47d0
slave setup bugfix
Sep 2, 2016
a4fe235
distrib matching bugfix
Sep 2, 2016
d4cc2fe
ephemeral storage block device listing for ubuntu amis
Sep 2, 2016
c771bb5
ephemeral blkdev links for ubuntu ami
Sep 2, 2016
81519f5
minor commit for debugging
Sep 2, 2016
00f069d
bugfix
Sep 2, 2016
25390ef
bugfix
Sep 2, 2016
b8a0297
bugfixes
Sep 2, 2016
748dde8
more ubuntu setup fixes
Sep 2, 2016
b7386a3
slave setup fixes for ubuntu
Sep 2, 2016
e69c730
master module start for ubuntu
Sep 2, 2016
d2e25ab
testing scala on ubuntu master
Sep 2, 2016
0e5229b
more master module init for ubuntu
Sep 2, 2016
e90b709
adapted tachyon, rstudio, gangliga inits to ubuntu
Sep 2, 2016
5d5ec76
more fix for ganglia
Sep 2, 2016
1558127
config command to deal with bad ganglia config
Sep 2, 2016
108aaff
more ganglia fix
Sep 2, 2016
6ded47a
taking out ganglia on ubuntu
Sep 2, 2016
e88a848
fixing ganglia and mapreduce init
Sep 2, 2016
e12a164
java setup and minor fixes for ubuntu
Sep 2, 2016
63af8d9
JAVA_HOME setup bugfix
Sep 2, 2016
76e9d5b
JAVA_HOME setup bugfix
Sep 2, 2016
60f3387
JAVA_HOME setup bugfix
Sep 2, 2016
ef5e815
adding git install to ubuntu setup
Sep 2, 2016
e94eaab
adding git install to ubuntu setup on slaves too
Sep 2, 2016
2dc3454
more ubuntu adapts in spark path
Sep 2, 2016
f3f4731
update apt before installing java
Sep 2, 2016
c8d0502
removing some ubuntu scaffolding
Sep 2, 2016
cfd4fa4
permission fixes for ubuntu, module setups enabled
Sep 2, 2016
9758812
more setup fixes for ubuntu
Sep 2, 2016
183b14a
debugging slave mnt chmod
Sep 2, 2016
46b7b39
master apt update only on first time java install
Sep 2, 2016
775b745
slave mnt permissions fix on ubuntu
Sep 3, 2016
fad89f2
putting back slave setup
Sep 3, 2016
fe06950
fixed template deployment; still debugging setup
Sep 3, 2016
cfff460
java setup on slaves, ephemeral hdfs works
Sep 3, 2016
2c06fc3
mapreduce setup updated for ubuntu
Sep 3, 2016
662b014
taking out hardcoded root path in spark env template
Sep 3, 2016
694e474
spark setup path fix
Sep 3, 2016
36ac7ed
all modules fixed except tachyon, rstudio, ganglia
Sep 3, 2016
a5e872e
spark setup paths made more robut
Sep 3, 2016
069159c
ubuntu ami list
Sep 3, 2016
5135ba4
converted ubuntu ami list to csv
Sep 3, 2016
3d1b120
removing stray spaces in ami list
Sep 3, 2016
de00b5d
ubuntu ami picker fixed
Sep 3, 2016
e226b9c
restructuring of java install command to fix path errors
Sep 3, 2016
d4bc7b5
java setup environment variable fix
Sep 7, 2016
3590401
ephemeral hdfs template fix for ubuntu
Sep 7, 2016
c760e15
taking out ganglia setup on ubuntu
Sep 7, 2016
eafd59f
ubuntu hdfs env fix
Sep 7, 2016
0a99851
bugfix
Sep 7, 2016
ccbc135
disabled persistent hdfs setup on ubuntu
Sep 7, 2016
c3398dc
bugfix for centos
Sep 9, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions ami-list-ubuntu/ami-list-ubuntu-amd64
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
ap-northeast-1,trusty,14.04 LTS,amd64,hvm:ebs,20160809.1,ami-03d01062,hvm
ap-northeast-1,trusty,14.04 LTS,amd64,hvm:ebs-io1,20160809.1,ami-90d111f1,hvm
ap-northeast-1,trusty,14.04 LTS,amd64,hvm:ebs-ssd,20160809.1,ami-49d31328,hvm
ap-northeast-1,trusty,14.04 LTS,amd64,hvm:instance-store,20160809.1,ami-55d21234,hvm
ap-northeast-1,trusty,14.04 LTS,amd64,ebs,20160809.1,ami-47d41426,aki-176bf516
ap-northeast-1,trusty,14.04 LTS,amd64,ebs-io1,20160809.1,ami-97d111f6,aki-176bf516
ap-northeast-1,trusty,14.04 LTS,amd64,ebs-ssd,20160809.1,ami-24d11145,aki-176bf516
ap-northeast-1,trusty,14.04 LTS,amd64,instance-store,20160809.1,ami-55d01034,aki-176bf516
ap-southeast-1,trusty,14.04 LTS,amd64,hvm:ebs,20160809.1,ami-b84799db,hvm
ap-southeast-1,trusty,14.04 LTS,amd64,hvm:ebs-io1,20160809.1,ami-f0459b93,hvm
ap-southeast-1,trusty,14.04 LTS,amd64,hvm:ebs-ssd,20160809.1,ami-5e429c3d,hvm
ap-southeast-1,trusty,14.04 LTS,amd64,hvm:instance-store,20160809.1,ami-41409e22,hvm
ap-southeast-1,trusty,14.04 LTS,amd64,ebs,20160809.1,ami-af4997cc,aki-503e7402
ap-southeast-1,trusty,14.04 LTS,amd64,ebs-io1,20160809.1,ami-af449acc,aki-503e7402
ap-southeast-1,trusty,14.04 LTS,amd64,ebs-ssd,20160809.1,ami-a2449ac1,aki-503e7402
ap-southeast-1,trusty,14.04 LTS,amd64,instance-store,20160809.1,ami-dc459bbf,aki-503e7402
ap-southeast-2,trusty,14.04 LTS,amd64,hvm:ebs,20160809.1,ami-47f1c524,hvm
ap-southeast-2,trusty,14.04 LTS,amd64,hvm:ebs-io1,20160809.1,ami-def2c6bd,hvm
ap-southeast-2,trusty,14.04 LTS,amd64,hvm:ebs-ssd,20160809.1,ami-25f3c746,hvm
ap-southeast-2,trusty,14.04 LTS,amd64,hvm:instance-store,20160809.1,ami-41f1c522,hvm
ap-southeast-2,trusty,14.04 LTS,amd64,ebs,20160809.1,ami-0cf0c46f,aki-c362fff9
ap-southeast-2,trusty,14.04 LTS,amd64,ebs-io1,20160809.1,ami-1df1c57e,aki-c362fff9
ap-southeast-2,trusty,14.04 LTS,amd64,ebs-ssd,20160809.1,ami-81f3c7e2,aki-c362fff9
ap-southeast-2,trusty,14.04 LTS,amd64,instance-store,20160809.1,ami-fef2c69d,aki-c362fff9
cn-north-1,trusty,14.04 LTS,amd64,hvm:ebs,20160714,ami-67af7a0a,hvm
cn-north-1,trusty,14.04 LTS,amd64,hvm:ebs-io1,20160714,ami-bfad78d2,hvm
cn-north-1,trusty,14.04 LTS,amd64,hvm:ebs-ssd,20160714,ami-bead78d3,hvm
cn-north-1,trusty,14.04 LTS,amd64,hvm:instance-store,20160714,ami-02af7a6f,hvm
cn-north-1,trusty,14.04 LTS,amd64,ebs,20160714,ami-58ae7b35,aki-9e8f1da7
cn-north-1,trusty,14.04 LTS,amd64,ebs-io1,20160714,ami-f2ad789f,aki-9e8f1da7
cn-north-1,trusty,14.04 LTS,amd64,ebs-ssd,20160714,ami-ccae7ba1,aki-9e8f1da7
cn-north-1,trusty,14.04 LTS,amd64,instance-store,20160714,ami-79ae7b14,aki-9e8f1da7
eu-central-1,trusty,14.04 LTS,amd64,hvm:ebs,20160809.1,ami-d3cd3bbc,hvm
eu-central-1,trusty,14.04 LTS,amd64,hvm:ebs-io1,20160809.1,ami-51cd3b3e,hvm
eu-central-1,trusty,14.04 LTS,amd64,hvm:ebs-ssd,20160809.1,ami-b1cf39de,hvm
eu-central-1,trusty,14.04 LTS,amd64,hvm:instance-store,20160809.1,ami-6acb3d05,hvm
eu-central-1,trusty,14.04 LTS,amd64,ebs,20160809.1,ami-d1cd3bbe,aki-184c7a05
eu-central-1,trusty,14.04 LTS,amd64,ebs-io1,20160809.1,ami-b6cf39d9,aki-184c7a05
eu-central-1,trusty,14.04 LTS,amd64,ebs-ssd,20160809.1,ami-09cf3966,aki-184c7a05
eu-central-1,trusty,14.04 LTS,amd64,instance-store,20160809.1,ami-d3cf39bc,aki-184c7a05
eu-west-1,trusty,14.04 LTS,amd64,hvm:ebs,20160809.1,ami-a7412ad4,hvm
eu-west-1,trusty,14.04 LTS,amd64,hvm:ebs-io1,20160809.1,ami-5a452e29,hvm
eu-west-1,trusty,14.04 LTS,amd64,hvm:ebs-ssd,20160809.1,ami-55452e26,hvm
eu-west-1,trusty,14.04 LTS,amd64,hvm:instance-store,20160809.1,ami-5d42292e,hvm
eu-west-1,trusty,14.04 LTS,amd64,ebs,20160809.1,ami-e4452e97,aki-52a34525
eu-west-1,trusty,14.04 LTS,amd64,ebs-io1,20160809.1,ami-3f472c4c,aki-52a34525
eu-west-1,trusty,14.04 LTS,amd64,ebs-ssd,20160809.1,ami-5b452e28,aki-52a34525
eu-west-1,trusty,14.04 LTS,amd64,instance-store,20160809.1,ami-07492274,aki-52a34525
sa-east-1,trusty,14.04 LTS,amd64,hvm:ebs,20160809.1,ami-e09d0b8c,hvm
sa-east-1,trusty,14.04 LTS,amd64,hvm:ebs-io1,20160809.1,ami-f89d0b94,hvm
sa-east-1,trusty,14.04 LTS,amd64,hvm:ebs-ssd,20160809.1,ami-97980efb,hvm
sa-east-1,trusty,14.04 LTS,amd64,hvm:instance-store,20160809.1,ami-1a980e76,hvm
sa-east-1,trusty,14.04 LTS,amd64,ebs,20160809.1,ami-16980e7a,aki-5553f448
sa-east-1,trusty,14.04 LTS,amd64,ebs-io1,20160809.1,ami-8b9a0ce7,aki-5553f448
sa-east-1,trusty,14.04 LTS,amd64,ebs-ssd,20160809.1,ami-98980ef4,aki-5553f448
sa-east-1,trusty,14.04 LTS,amd64,instance-store,20160809.1,ami-6c9f0900,aki-5553f448
us-east-1,trusty,14.04 LTS,amd64,hvm:ebs,20160809.1,ami-d90d92ce,hvm
us-east-1,trusty,14.04 LTS,amd64,hvm:ebs-io1,20160809.1,ami-1b0d920c,hvm
us-east-1,trusty,14.04 LTS,amd64,hvm:ebs-ssd,20160809.1,ami-8e0b9499,hvm
us-east-1,trusty,14.04 LTS,amd64,hvm:instance-store,20160809.1,ami-08128d1f,hvm
us-east-1,trusty,14.04 LTS,amd64,ebs,20160809.1,ami-c70f90d0,aki-919dcaf8
us-east-1,trusty,14.04 LTS,amd64,ebs-io1,20160809.1,ami-510c9346,aki-919dcaf8
us-east-1,trusty,14.04 LTS,amd64,ebs-ssd,20160809.1,ami-6808977f,aki-919dcaf8
us-east-1,trusty,14.04 LTS,amd64,instance-store,20160809.1,ami-b266f9a5,aki-919dcaf8
us-gov-west-1,trusty,14.04 LTS,amd64,hvm:ebs,20160809.1,ami-3508b654,hvm
us-gov-west-1,trusty,14.04 LTS,amd64,hvm:ebs-io1,20160809.1,ami-2e0bb54f,hvm
us-gov-west-1,trusty,14.04 LTS,amd64,hvm:ebs-ssd,20160809.1,ami-2a08b64b,hvm
us-gov-west-1,trusty,14.04 LTS,amd64,hvm:instance-store,20160809.1,ami-2809b749,hvm
us-gov-west-1,trusty,14.04 LTS,amd64,ebs,20160809.1,ami-600cb201,aki-1de98d3e
us-gov-west-1,trusty,14.04 LTS,amd64,ebs-io1,20160809.1,ami-780fb119,aki-1de98d3e
us-gov-west-1,trusty,14.04 LTS,amd64,ebs-ssd,20160809.1,ami-ab0bb5ca,aki-1de98d3e
us-gov-west-1,trusty,14.04 LTS,amd64,instance-store,20160809.1,ami-2b0bb54a,aki-1de98d3e
us-west-1,trusty,14.04 LTS,amd64,hvm:ebs,20160809.1,ami-27743747,hvm
us-west-1,trusty,14.04 LTS,amd64,hvm:ebs-io1,20160809.1,ami-577a3937,hvm
us-west-1,trusty,14.04 LTS,amd64,hvm:ebs-ssd,20160809.1,ami-547b3834,hvm
us-west-1,trusty,14.04 LTS,amd64,hvm:instance-store,20160809.1,ami-fd74379d,hvm
us-west-1,trusty,14.04 LTS,amd64,ebs,20160809.1,ami-d47a39b4,aki-880531cd
us-west-1,trusty,14.04 LTS,amd64,ebs-io1,20160809.1,ami-11753671,aki-880531cd
us-west-1,trusty,14.04 LTS,amd64,ebs-ssd,20160809.1,ami-31753651,aki-880531cd
us-west-1,trusty,14.04 LTS,amd64,instance-store,20160809.1,ami-33773453,aki-880531cd
us-west-2,trusty,14.04 LTS,amd64,hvm:ebs,20160809.1,ami-20be7540,hvm
us-west-2,trusty,14.04 LTS,amd64,hvm:ebs-io1,20160809.1,ami-dcb57ebc,hvm
us-west-2,trusty,14.04 LTS,amd64,hvm:ebs-ssd,20160809.1,ami-70b67d10,hvm
us-west-2,trusty,14.04 LTS,amd64,hvm:instance-store,20160809.1,ami-a9b972c9,hvm
us-west-2,trusty,14.04 LTS,amd64,ebs,20160809.1,ami-abb07bcb,aki-fc8f11cc
us-west-2,trusty,14.04 LTS,amd64,ebs-io1,20160809.1,ami-88b07be8,aki-fc8f11cc
us-west-2,trusty,14.04 LTS,amd64,ebs-ssd,20160809.1,ami-73b67d13,aki-fc8f11cc
us-west-2,trusty,14.04 LTS,amd64,instance-store,20160809.1,ami-a3bf74c3,aki-fc8f11cc
2 changes: 1 addition & 1 deletion copy-dir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ DIR=`readlink -f "$1"`
DIR=`echo "$DIR"|sed 's@/$@@'`
DEST=`dirname "$DIR"`

SLAVES=`cat /root/spark-ec2/slaves`
SLAVES=`cat ~/spark-ec2/slaves`

SSH_OPTS="-o StrictHostKeyChecking=no -o ConnectTimeout=5"

Expand Down
Empty file modified deploy.generic/root/spark-ec2/ec2-variables.sh
100644 → 100755
Empty file.
34 changes: 34 additions & 0 deletions deploy.ubuntu/home/ubuntu/spark-ec2/ec2-variables.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash

#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# These variables are automatically filled in by the spark-ec2 script.
export MASTERS="{{master_list}}"
export SLAVES="{{slave_list}}"
export HDFS_DATA_DIRS="{{hdfs_data_dirs}}"
export MAPRED_LOCAL_DIRS="{{mapred_local_dirs}}"
export SPARK_LOCAL_DIRS="{{spark_local_dirs}}"
export MODULES="{{modules}}"
export SPARK_VERSION="{{spark_version}}"
export TACHYON_VERSION="{{tachyon_version}}"
export HADOOP_MAJOR_VERSION="{{hadoop_major_version}}"
export SWAP_MB="{{swap}}"
export SPARK_WORKER_INSTANCES="{{spark_worker_instances}}"
export SPARK_MASTER_OPTS="{{spark_master_opts}}"
export AWS_ACCESS_KEY_ID="{{aws_access_key_id}}"
export AWS_SECRET_ACCESS_KEY="{{aws_secret_access_key}}"
11 changes: 8 additions & 3 deletions deploy_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
master_ram_kb = int(
os.popen(mem_command).read().strip())
# This is the master's memory. Try to find slave's memory as well
first_slave = os.popen("cat /root/spark-ec2/slaves | head -1").read().strip()
first_slave = os.popen("cat ~/spark-ec2/slaves | head -1").read().strip()

slave_mem_command = "ssh -t -o StrictHostKeyChecking=no %s %s" %\
(first_slave, mem_command)
Expand Down Expand Up @@ -80,19 +80,24 @@
"aws_secret_access_key": os.getenv("AWS_SECRET_ACCESS_KEY"),
}

template_dir="/root/spark-ec2/templates"
deploy_root_dir = os.getenv("DEPLOY_ROOT_DIR")

template_dir=deploy_root_dir+"/spark-ec2/templates"
tmp_template_dir=os.getenv("TMP_TEMPLATE_DIR")

for path, dirs, files in os.walk(template_dir):
if path.find(".svn") == -1:
dest_dir = os.path.join('/', path[len(template_dir):])
if dest_dir.startswith("/root"):
dest_dir = deploy_root_dir + dest_dir[5:]
dest_dir = "/tmp/templates/" + dest_dir
if not os.path.exists(dest_dir):
os.makedirs(dest_dir)
for filename in files:
if filename[0] not in '#.~' and filename[-1] != '~':
dest_file = os.path.join(dest_dir, filename)
with open(os.path.join(path, filename)) as src:
with open(dest_file, "w") as dest:
print("Configuring " + dest_file)
text = src.read()
for key in template_vars:
text = text.replace("{{" + key + "}}", template_vars[key] or '')
Expand Down
18 changes: 9 additions & 9 deletions ephemeral-hdfs/init.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

pushd /root > /dev/null
pushd ~ > /dev/null

if [ -d "ephemeral-hdfs" ]; then
echo "Ephemeral HDFS seems to be installed. Exiting."
Expand All @@ -14,8 +14,8 @@ case "$HADOOP_MAJOR_VERSION" in
tar xvzf hadoop-1.0.4.tar.gz > /tmp/spark-ec2_hadoop.log
rm hadoop-*.tar.gz
mv hadoop-1.0.4/ ephemeral-hdfs/
sed -i 's/-jvm server/-server/g' /root/ephemeral-hdfs/bin/hadoop
cp /root/hadoop-native/* /root/ephemeral-hdfs/lib/native/
sed -i 's/-jvm server/-server/g' ~/ephemeral-hdfs/bin/hadoop
cp ~/hadoop-native/* ~/ephemeral-hdfs/lib/native/
;;
2)
wget http://s3.amazonaws.com/spark-related-packages/hadoop-2.0.0-cdh4.2.0.tar.gz
Expand All @@ -25,9 +25,9 @@ case "$HADOOP_MAJOR_VERSION" in
mv hadoop-2.0.0-cdh4.2.0/ ephemeral-hdfs/

# Have single conf dir
rm -rf /root/ephemeral-hdfs/etc/hadoop/
ln -s /root/ephemeral-hdfs/conf /root/ephemeral-hdfs/etc/hadoop
cp /root/hadoop-native/* /root/ephemeral-hdfs/lib/native/
rm -rf ~/ephemeral-hdfs/etc/hadoop/
ln -s ~/ephemeral-hdfs/conf ~/ephemeral-hdfs/etc/hadoop
cp ~/hadoop-native/* ~/ephemeral-hdfs/lib/native/
;;
yarn)
wget http://s3.amazonaws.com/spark-related-packages/hadoop-2.4.0.tar.gz
Expand All @@ -37,14 +37,14 @@ case "$HADOOP_MAJOR_VERSION" in
mv hadoop-2.4.0/ ephemeral-hdfs/

# Have single conf dir
rm -rf /root/ephemeral-hdfs/etc/hadoop/
ln -s /root/ephemeral-hdfs/conf /root/ephemeral-hdfs/etc/hadoop
rm -rf ~/ephemeral-hdfs/etc/hadoop/
ln -s ~/ephemeral-hdfs/conf ~/ephemeral-hdfs/etc/hadoop
;;

*)
echo "ERROR: Unknown Hadoop version"
return 1
esac
/root/spark-ec2/copy-dir /root/ephemeral-hdfs
~/spark-ec2/copy-dir ~/ephemeral-hdfs

popd > /dev/null
11 changes: 11 additions & 0 deletions ephemeral-hdfs/setup-slave.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#!/bin/bash

#learn the linux distribution
DISTRIB_ID=Centos
if [[ -e /etc/lsb-release ]]; then source /etc/lsb-release; fi
echo "DISTRIB_ID=$DISTRIB_ID"

if [[ $DISTRIB_ID = "Ubuntu" ]]; then
[[ ! -e /var/hadoop ]] && sudo mkdir /var/hadoop
sudo chmod 777 /var/hadoop
fi

# Setup ephemeral-hdfs
mkdir -p /mnt/ephemeral-hdfs/logs
mkdir -p /mnt/hadoop-logs
Expand All @@ -24,3 +34,4 @@ create_hadoop_dirs /mnt
create_hadoop_dirs /mnt2
create_hadoop_dirs /mnt3
create_hadoop_dirs /mnt4

26 changes: 22 additions & 4 deletions ephemeral-hdfs/setup.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
#!/bin/bash

EPHEMERAL_HDFS=/root/ephemeral-hdfs
#learn the linux distribution
DISTRIB_ID=Centos
if [[ -e /etc/lsb-release ]]; then source /etc/lsb-release; fi
echo "DISTRIB_ID=$DISTRIB_ID"

EPHEMERAL_HDFS=~/ephemeral-hdfs
USER=`whoami`

# Set hdfs url to make it easier
HDFS_URL="hdfs://$PUBLIC_DNS:9000"
echo "export HDFS_URL=$HDFS_URL" >> ~/.bash_profile

pushd /root/spark-ec2/ephemeral-hdfs > /dev/null
pushd ~/spark-ec2/ephemeral-hdfs > /dev/null
source ./setup-slave.sh

for node in $SLAVES $OTHER_MASTERS; do
echo $node
ssh -t -t $SSH_OPTS root@$node "/root/spark-ec2/ephemeral-hdfs/setup-slave.sh" & sleep 0.3
ssh -t -t $SSH_OPTS $USER@$node "~/spark-ec2/ephemeral-hdfs/setup-slave.sh" & sleep 0.3
done
wait

/root/spark-ec2/copy-dir $EPHEMERAL_HDFS/conf
~/spark-ec2/copy-dir $EPHEMERAL_HDFS/conf

NAMENODE_DIR=/mnt/ephemeral-hdfs/dfs/name

Expand All @@ -31,12 +37,24 @@ echo "Starting ephemeral HDFS..."
# This is different depending on version.
case "$HADOOP_MAJOR_VERSION" in
1)
if [[ $DISTRIB_ID = "Ubuntu" ]]; then
echo "ERROR: Unsupported hadoop version on Ubuntu"
return -1
fi
$EPHEMERAL_HDFS/bin/start-dfs.sh
;;
2)
if [[ $DISTRIB_ID = "Ubuntu" ]]; then
[[ ! -e /var/hadoop ]] && sudo mkdir /var/hadoop
sudo chmod 777 /var/hadoop
fi
$EPHEMERAL_HDFS/sbin/start-dfs.sh
;;
yarn)
if [[ $DISTRIB_ID = "Ubuntu" ]]; then
[[ ! -e /var/hadoop ]] && sudo mkdir /var/hadoop
sudo chmod 777 /var/hadoop
fi
$EPHEMERAL_HDFS/sbin/start-dfs.sh
echo "Starting YARN"
$EPHEMERAL_HDFS/sbin/start-yarn.sh
Expand Down
64 changes: 44 additions & 20 deletions ganglia/init.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,26 +1,50 @@
#!/bin/bash

# NOTE: Remove all rrds which might be around from an earlier run
rm -rf /var/lib/ganglia/rrds/*
rm -rf /mnt/ganglia/rrds/*

# Make sure rrd storage directory has right permissions
mkdir -p /mnt/ganglia/rrds
chown -R nobody:nobody /mnt/ganglia/rrds
USER=`whoami`

# Install ganglia
# TODO: Remove this once the AMI has ganglia by default
#learn the linux distribution
DISTRIB_ID=Centos
if [[ -e /etc/lsb-release ]]; then source /etc/lsb-release; fi
echo "DISTRIB_ID=$DISTRIB_ID"

GANGLIA_PACKAGES="ganglia ganglia-web ganglia-gmond ganglia-gmetad"
if [[ $DISTRIB_ID = "Centos" ]]; then

# NOTE: Remove all rrds which might be around from an earlier run
sudo rm -rf /var/lib/ganglia/rrds/*
sudo rm -rf /mnt/ganglia/rrds/*

# Make sure rrd storage directory has right permissions
mkdir -p /mnt/ganglia/rrds
chown -R nobody:nobody /mnt/ganglia/rrds

# Install ganglia
# TODO: Remove this once the AMI has ganglia by default


GANGLIA_PACKAGES="ganglia ganglia-web ganglia-gmond ganglia-gmetad"
if ! rpm --quiet -q $GANGLIA_PACKAGES; then
yum install -q -y $GANGLIA_PACKAGES;
fi
for node in $SLAVES $OTHER_MASTERS; do
ssh -t -t $SSH_OPTS root@$node "if ! rpm --quiet -q $GANGLIA_PACKAGES; then yum install -q -y $GANGLIA_PACKAGES; fi" & sleep 0.3
done
wait

# Post-package installation : Symlink /var/lib/ganglia/rrds to /mnt/ganglia/rrds
if [[ -d /var/lib/ganglia/rrds ]]; then sudo rmdir /var/lib/ganglia/rrds; fi
sudo ln -s /mnt/ganglia/rrds /var/lib/ganglia/rrds

elif [[ $DISTRIB_ID = "Ubuntu" ]]; then
echo "WARNING: Skipping ganglia on ubuntu..."
#GANGLIA_PACKAGES="ganglia-webfrontend ganglia-monitor gmetad"
#sudo apt-get install -y $GANGLIA_PACKAGES
#for node in $SLAVES $OTHER_MASTERS; do
# ssh -t -t $SSH_OPTS $USER@$node "sudo apt-get install -y $GANGLIA_PACKAGES; sudo dpkg --configure -a" & sleep 0.3
#done
#wait

## Post-package installation : Symlink /var/lib/ganglia/rrds to /mnt/ganglia/rrds
#if [[ -d /var/lib/ganglia/rrds ]]; then sudo rmdir /var/lib/ganglia/rrds; fi
#sudo ln -s /mnt/ganglia/rrds /var/lib/ganglia/rrds

if ! rpm --quiet -q $GANGLIA_PACKAGES; then
yum install -q -y $GANGLIA_PACKAGES;
fi
for node in $SLAVES $OTHER_MASTERS; do
ssh -t -t $SSH_OPTS root@$node "if ! rpm --quiet -q $GANGLIA_PACKAGES; then yum install -q -y $GANGLIA_PACKAGES; fi" & sleep 0.3
done
wait

# Post-package installation : Symlink /var/lib/ganglia/rrds to /mnt/ganglia/rrds
rmdir /var/lib/ganglia/rrds
ln -s /mnt/ganglia/rrds /var/lib/ganglia/rrds
Loading