Skip to content
Permalink
Browse files
BIGTOP-1564. docker-puppet doesn't use vagrantconfg.yaml for configur…
…ation parameters
  • Loading branch information
evans-ye committed Jan 7, 2015
1 parent 6234d48 commit c8a61d98f96c23da3b0ae954abb753b1a36eaf52
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 13 deletions.
@@ -11,3 +11,4 @@ target
.idea
.gradle
gradle*
.vagrant
@@ -165,11 +165,10 @@ Note: If running on OS X or Windows, the boot2docker VM should be reloaded after


##Configure Apache Hadoop ecosystem components

* Choose the ecosystem you want to be deployed by modifying components in provision.sh.
* Choose the ecosystem you want to be deployed by modifying components in vagrantconfig.yaml

```
components,hadoop,hbase,yarn,...
components: "hadoop,hbase,yarn,..."
```

By default, Apache Hadoop, YARN, and Apache HBase will be installed.
@@ -20,50 +20,66 @@ build-image() {
>&2 echo -e "\nBUILD IMAGE FAILED!\n"
exit 2
}
vagrant destroy image -f
}

create() {
echo "\$num_instances = $1" > config.rb
vagrant up --no-parallel
nodes=(`vagrant status |grep running |awk '{print $1}'`)
nodes=(`vagrant status |grep running |grep -v image |awk '{print $1}'`)
hadoop_head_node=(`echo "hostname -f" |vagrant ssh ${nodes[0]} |tail -n 1`)
repo=$(get-yaml-config repo)
components=$(get-yaml-config components)
echo "/bigtop-home/bigtop-deploy/vm/utils/setup-env.sh" |vagrant ssh ${nodes[0]}
echo "/vagrant/provision.sh $hadoop_head_node" |vagrant ssh ${nodes[0]}
echo "/vagrant/provision.sh $hadoop_head_node $repo $components" |vagrant ssh ${nodes[0]}
bigtop-puppet ${nodes[0]}
for ((i=1 ; i<${#nodes[*]} ; i++)); do
(
echo "/bigtop-home/bigtop-deploy/vm/utils/setup-env.sh" |vagrant ssh ${nodes[$i]}
echo "/vagrant/provision.sh $hadoop_head_node" |vagrant ssh ${nodes[$i]}
echo "/vagrant/provision.sh $hadoop_head_node $repo $components" |vagrant ssh ${nodes[$i]}
bigtop-puppet ${nodes[$i]}
) &
done
wait
}

provision() {
nodes=(`vagrant status |grep running |awk '{print $1}'`)
nodes=(`vagrant status |grep running |grep -v image |awk '{print $1}'`)
for node in $nodes; do
bigtop-puppet $node &
done
wait
}

smoke-tests() {
nodes=(`vagrant status |grep running |awk '{print $1}'`)
nodes=(`vagrant status |grep running |grep -v image |awk '{print $1}'`)
echo "/bigtop-home/bigtop-deploy/vm/utils/smoke-tests.sh" |vagrant ssh ${nodes[0]}
}


destroy() {
vagrant destroy -f
rm -rf ./hosts ./config
rm -rf ./hosts ./config ./config.rb
nodes=(`vagrant status |grep running |grep -v image |awk '{print $1}'`)
for node in $nodes; do
vagrant destroy -f $node
done
wait
}

bigtop-puppet() {
echo "puppet apply -d --confdir=/vagrant --modulepath=/bigtop-home/bigtop-deploy/puppet/modules:/etc/puppet/modules /bigtop-home/bigtop-deploy/puppet/manifests/site.pp" |vagrant ssh $1
}

get-yaml-config() {
RUBY_EXE=ruby
which ruby > /dev/null 2>&1
if [ $? -ne 0 ]; then
# use vagrant embedded ruby on Windows
RUBY_EXE=$(dirname $(which vagrant))/../embedded/bin/ruby
fi
RUBY_SCRIPT="data = YAML::load(STDIN.read); puts data['$1'];"
cat vagrantconfig.yaml | $RUBY_EXE -ryaml -e "$RUBY_SCRIPT" | tr -d '\r'
}

PROG=`basename $0`

if [ $# -eq 0 ]; then
@@ -30,7 +30,7 @@ mkdir /vagrant/config
cat > /vagrant/config/site.csv << EOF
hadoop_head_node,$1
hadoop_storage_dirs,/data/1,/data/2
bigtop_yumrepo_uri,http://bigtop01.cloudera.org:8080/view/Releases/job/Bigtop-0.8.0/label=centos6/6/artifact/output/
bigtop_yumrepo_uri,$2
jdk_package_name,java-1.7.0-openjdk-devel.x86_64
components,hadoop,hbase,yarn
components,$3
EOF
@@ -6,6 +6,8 @@ boot2docker:
memory_size: "4196"
number_cpus: "2"

repo: "http://bigtop01.cloudera.org:8080/view/Releases/job/Bigtop-0.8.0/label=centos6/6/artifact/output/"
components: "hadoop,yarn"
namenode_ui_port: "50070"
yarn_ui_port: "8088"
hbase_ui_port: "60010"

0 comments on commit c8a61d9

Please sign in to comment.