Commit 06e1878b authored by David Johnson's avatar David Johnson

Simplify the hadoop image creation and track modified conf files.

Lots of little changes here (but the experiment configuration for the
paper experiments is preserved)... now all the hadoop setup scripts and
config files that are baked into the hadoop VM image are stored here in
the source tree, and then are also placed in the overall capnet ext
tarball that osp-capnet.py references.  Thus, no need for all the extra
and conf tarballs.  Now we only download hadoop and a wordfile (for
reproducibility of input) from www.emulab.net when we create the hadoop
image.

The hadoop config files included here are the ones that we need and are
working.  During image creation, they get baked into a tarball in the
image, and then extracted at VM runtime once the hadoop install scripts
have unpacked the hadoop tarball.  We wait til runtime to unpack hadoop
because it's huge.  But the conf dir we use is in the unpacked dir,
hence the need to wait to unpack our overlay conf tarball.

The hadoop config files here are slightly different than Unni's (but of
course they are the ones we used for the paper); there
are changes so that the slaves can contact the tracker on the master (I
think that's what it was); and more imporantly JVM and hadoop memory
limit adjustments to make the wordcount case work for our experiments.
I don't know how well they'll work for others... I might have
inadvertently required that VMs have 4096MB of memory minimum :(.  But
that is ok for us.
parent 3ce36330
Pipeline #1552 skipped
......@@ -12,7 +12,7 @@ TBURL = "http://www.emulab.net/downloads/openstack-setup-v26-capnet.tar.gz"
TBCMD = "sudo mkdir -p /root/setup && sudo -H /tmp/setup/setup-driver.sh 2>&1 | sudo tee /root/setup/setup-driver.log"
EXT_TARBALLS = []
CAPNET_TBURL = "http://www.emulab.net/downloads/openstack-setup-ext-capnet-v1.tar.gz"
CAPNET_TBURL = "http://www.emulab.net/downloads/openstack-setup-ext-capnet-v2.tar.gz"
#
# Create our in-memory model of the RSpec -- the resources we're going to request
......
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://master:9000/</value>
</property>
</configuration>
# 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.
# Set Hadoop-specific environment variables here.
# The only required environment variable is JAVA_HOME. All others are
# optional. When running a distributed configuration it is best to
# set JAVA_HOME in this file, so that it is correctly defined on
# remote nodes.
# The java implementation to use.
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
# The jsvc implementation to use. Jsvc is required to run secure datanodes
# that bind to privileged ports to provide authentication of data transfer
# protocol. Jsvc is not required if SASL is configured for authentication of
# data transfer protocol using non-privileged ports.
#export JSVC_HOME=${JSVC_HOME}
export HADOOP_CONF_DIR=/home/ubuntu/hadoop-2.7.1/etc/hadoop
# Extra Java CLASSPATH elements. Automatically insert capacity-scheduler.
for f in $HADOOP_HOME/contrib/capacity-scheduler/*.jar; do
if [ "$HADOOP_CLASSPATH" ]; then
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$f
else
export HADOOP_CLASSPATH=$f
fi
done
# The maximum amount of heap to use, in MB. Default is 1000.
#export HADOOP_HEAPSIZE=
#export HADOOP_NAMENODE_INIT_HEAPSIZE=""
# Extra Java runtime options. Empty by default.
export HADOOP_OPTS="$HADOOP_OPTS -Djava.net.preferIPv4Stack=true"
# Command specific options appended to HADOOP_OPTS when specified
export HADOOP_NAMENODE_OPTS="-Dhadoop.security.logger=${HADOOP_SECURITY_LOGGER:-INFO,RFAS} -Dhdfs.audit.logger=${HDFS_AUDIT_LOGGER:-INFO,NullAppender} $HADOOP_NAMENODE_OPTS"
export HADOOP_DATANODE_OPTS="-Dhadoop.security.logger=ERROR,RFAS $HADOOP_DATANODE_OPTS"
export HADOOP_SECONDARYNAMENODE_OPTS="-Dhadoop.security.logger=${HADOOP_SECURITY_LOGGER:-INFO,RFAS} -Dhdfs.audit.logger=${HDFS_AUDIT_LOGGER:-INFO,NullAppender} $HADOOP_SECONDARYNAMENODE_OPTS"
export HADOOP_NFS3_OPTS="$HADOOP_NFS3_OPTS"
export HADOOP_PORTMAP_OPTS="-Xmx512m $HADOOP_PORTMAP_OPTS"
# The following applies to multiple commands (fs, dfs, fsck, distcp etc)
export HADOOP_CLIENT_OPTS="-Xmx512m $HADOOP_CLIENT_OPTS"
#HADOOP_JAVA_PLATFORM_OPTS="-XX:-UsePerfData $HADOOP_JAVA_PLATFORM_OPTS"
# On secure datanodes, user to run the datanode as after dropping privileges.
# This **MUST** be uncommented to enable secure HDFS if using privileged ports
# to provide authentication of data transfer protocol. This **MUST NOT** be
# defined if SASL is configured for authentication of data transfer protocol
# using non-privileged ports.
export HADOOP_SECURE_DN_USER=${HADOOP_SECURE_DN_USER}
# Where log files are stored. $HADOOP_HOME/logs by default.
#export HADOOP_LOG_DIR=${HADOOP_LOG_DIR}/$USER
# Where log files are stored in the secure data environment.
export HADOOP_SECURE_DN_LOG_DIR=${HADOOP_LOG_DIR}/${HADOOP_HDFS_USER}
###
# HDFS Mover specific parameters
###
# Specify the JVM options to be used when starting the HDFS Mover.
# These options will be appended to the options specified as HADOOP_OPTS
# and therefore may override any similar flags set in HADOOP_OPTS
#
# export HADOOP_MOVER_OPTS=""
###
# Advanced Users Only!
###
# The directory where pid files are stored. /tmp by default.
# NOTE: this should be set to a directory that can only be written to by
# the user that will run the hadoop daemons. Otherwise there is the
# potential for a symlink attack.
export HADOOP_PID_DIR=${HADOOP_PID_DIR}
export HADOOP_SECURE_DN_PID_DIR=${HADOOP_PID_DIR}
# A string representing this instance of hadoop. $USER by default.
export HADOOP_IDENT_STRING=$USER
<configuration>
<property>
<name>dfs.namenode.name.dir</name>
<value>/mnt/hadoop</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>/mnt/datanode</value>
</property>
</configuration>
<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
<property>
<name>mapreduce.jobhistory.webapp.address</name>
<value>0.0.0.0:19888</value>
</property>
<property>
<name>mapred.child.java.opts</name>
<value>-Xmx3072m</value>
</property>
<property>
<name>mapreduce.map.memory.mb</name>
<value>4096</value>
</property>
<property>
<name>mapreduce.reduce.memory.mb</name>
<value>4096</value>
</property>
<property>
<name>mapreduce.map.java.opts</name>
<value>-Xmx3072m</value>
</property>
<property>
<name>mapreduce.reduce.java.opts</name>
<value>-Xmx3072m</value>
</property>
</configuration>
<configuration>
<property>
<name>yarn.resourcemanager.hostname</name>
<value>resourcemanager</value>
</property>
<property>
<name>yarn.resourcemanager.webapp.address</name>
<value>master:8088</value>
</property>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.resourcemanager.scheduler.address</name>
<value>master:8030</value>
</property>
<property>
<name>yarn.resourcemanager.address</name>
<value>master:8032</value>
</property>
<property>
<name>yarn.resourcemanager.resource-tracker.address</name>
<value>master:8031</value>
</property>
<property>
<name>yarn.resourcemanager.admin.address</name>
<value>master:8033</value>
</property>
<property>
<name>yarn.nodemanager.vmem-pmem-ratio</name>
<value>4.2</value>
</property>
<property>
<name>yarn.nodemanager.vmem-check-enabled</name>
<value>false</value>
</property>
</configuration>
......@@ -5,7 +5,7 @@ set -x
if [ $# -gt 0 ]; then
SIZE=$1
else
SIZE=`expr 1024*1024*10`
SIZE=`expr 1024 \* 1024 \* 10`
fi
HADOOPDIR=/home/ubuntu/hadoop-2.7.1
......
......@@ -8,6 +8,7 @@ HOMEDIR=/home/ubuntu
TARBALLDIR="$HOMEDIR"
HADOOPTARBALL="${TARBALLDIR}/hadoop-2.7.1.tar.gz"
HADOOPDIR="$HOMEDIR/hadoop-2.7.1"
MCTARBALL="${TARBALLDIR}/hadoop_master_conf.tar.gz"
RMCTARBALL="${TARBALLDIR}/hadoop_resourcemanager_conf.tar.gz"
SCTARBALL="${TARBALLDIR}/hadoop_slaves_conf.tar.gz"
#MCTARBALL="${TARBALLDIR}/hadoop_master_conf.tar.gz"
#RMCTARBALL="${TARBALLDIR}/hadoop_resourcemanager_conf.tar.gz"
#SCTARBALL="${TARBALLDIR}/hadoop_slaves_conf.tar.gz"
GCTARBALL="${TARBALLDIR}/hadoop_generic_conf.tar.gz"
......@@ -10,16 +10,22 @@ DIRNAME=`dirname $0`
#
tar -xzvf $HADOOPTARBALL -C $HOMEDIR
cp -pR $HADOOPDIR/etc/hadoop $HADOOPDIR/etc/hadoop.bak
rm -rf $HADOOPDIR/etc/hadoop
tar -xzvf $MCTARBALL -C $HADOOPDIR/etc/
#rm -rf $HADOOPDIR/etc/hadoop
#tar -xzvf $MCTARBALL -C $HADOOPDIR/etc/
#sudo rsync -av hadoop_master_conf/hadoop/ /etc/hadoop/
# NB: just extract the generic config tarball now
tar -xzvf $GCTARBALL -C $HADOOPDIR/etc/
#
# Copy the slaves file into place
#
cp $HOMEDIR/slaves.namefile $HADOOPDIR/etc/hadoop/slaves
echo master >> $HADOOPDIR/etc/hadoop/slaves
# Note down the master
echo master > $HADOOPDIR/etc/hadoop/master
mkdir -p $HADOOPDIR/logs
chmod 777 $HADOOPDIR/logs
......
......@@ -10,10 +10,13 @@ DIRNAME=`dirname $0`
#
tar -xzvf $HADOOPTARBALL -C $HOMEDIR
cp -pR $HADOOPDIR/etc/hadoop $HADOOPDIR/etc/hadoop.bak
rm -rf $HADOOPDIR/etc/hadoop
tar -xzvf $RMCTARBALL -C $HADOOPDIR/etc/
#rm -rf $HADOOPDIR/etc/hadoop
#tar -xzvf $RMCTARBALL -C $HADOOPDIR/etc/
#sudo rsync -av hadoop_resourcemanager_conf/hadoop/ /etc/hadoop/
# NB: just extract the generic config tarball now
tar -xzvf $GCTARBALL -C $HADOOPDIR/etc/
#
# Copy the slaves file into place
#
......
......@@ -10,10 +10,13 @@ DIRNAME=`dirname $0`
#
tar -xzvf $HADOOPTARBALL -C $HOMEDIR
cp -pR $HADOOPDIR/etc/hadoop $HADOOPDIR/etc/hadoop.bak
rm -rf $HADOOPDIR/etc/hadoop
tar -xzvf $SCTARBALL -C $HADOOPDIR/etc/
#rm -rf $HADOOPDIR/etc/hadoop
#tar -xzvf $SCTARBALL -C $HADOOPDIR/etc/
#sudo rsync -av hadoop_resourcemanager_conf/hadoop/ /etc/hadoop/
# NB: just extract the generic config tarball now
tar -xzvf $GCTARBALL -C $HADOOPDIR/etc/
#
# Copy the slaves file into place
#
......
......@@ -239,14 +239,28 @@ EOF
# Install hadoop and our config files
chroot $MNT /usr/bin/apt-get update
chroot $MNT /usr/bin/apt-get install -y vim-nox openjdk-7-jdk expect pssh
chroot $MNT /usr/bin/apt-get install -y openjdk-7-jdk pssh
chroot $MNT /usr/bin/apt-get clean all
wget http://www.emulab.net/downloads/hadoop-2.7.1.tar.gz
wget http://www.emulab.net/downloads/openstack-capnet-hadoop-files-v1.tar.gz
# Download hadoop and our word file.
wget -O hadoop-2.7.1.tar.gz \
http://www.emulab.net/downloads/hadoop-2.7.1.tar.gz
wget -O openstack-capnet-hadoop-words.txt.tar.gz \
http://www.emulab.net/downloads/openstack-capnet-hadoop-words.txt.tar.gz
# Let the VM extract the hadoop tarball once the disk has been expanded;
# it's big. But put the word file into place right away...
cp hadoop-2.7.1.tar.gz $MNT/home/ubuntu
tar -xzvf openstack-capnet-hadoop-files-v1.tar.gz -C $MNT/home/ubuntu
tar -xzvf openstack-capnet-hadoop-words.txt.tar.gz -C $MNT/home/ubuntu
# Copy the hadoop setup scripts from the src tarball into the the disk image
rsync -av $DIRNAME/hadoop/*.sh $MNT/home/ubuntu/
# Make our generic conf tarball from the src tree, and put it into the
# image to be extracted later.
cwd=`pwd`
(cd $DIRNAME/hadoop/etc && tar -czvf $DIRNAME/hadoop_generic_conf.tar.gz ./* ; cd $cwd)
cp $DIRNAME/hadoop_generic_conf.tar.gz $MNT/home/ubuntu
mkdir -p $MNT/root/.ssh
chmod 700 $MNT/root/.ssh
......
......@@ -17,4 +17,4 @@ SETUPLIB=/tmp/setup/setup-lib.sh
PSSH='/usr/bin/parallel-ssh -t 0 -O StrictHostKeyChecking=no '
PSCP='/usr/bin/parallel-scp -t 0 -O StrictHostKeyChecking=no '
SSH='/usr/bin/ssh -o StrictHostKeyChecking=no '
SCP='/usr/bin/scp -o StrictHostKeyChecking=no '
SCP='/usr/bin/ssh -o StrictHostKeyChecking=no '
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment