aboutsummaryrefslogtreecommitdiff
path: root/bigtop-deploy
diff options
context:
space:
mode:
authorevans_ye <innovansye@gmail.com>2014-12-28 17:17:16 +0000
committerevans_ye <innovansye@gmail.com>2015-01-07 15:52:36 +0000
commitc8a61d98f96c23da3b0ae954abb753b1a36eaf52 (patch)
treea0b25f8c4de8592904cac5a29ec8df6c9b25edc9 /bigtop-deploy
parent6234d48380832e56ba0bc3979b2b1c1eae379edd (diff)
BIGTOP-1564. docker-puppet doesn't use vagrantconfg.yaml for configuration parameters
Diffstat (limited to 'bigtop-deploy')
-rw-r--r--bigtop-deploy/vm/docker-puppet/README.md5
-rwxr-xr-xbigtop-deploy/vm/docker-puppet/docker-hadoop.sh32
-rwxr-xr-xbigtop-deploy/vm/docker-puppet/provision.sh4
-rw-r--r--bigtop-deploy/vm/docker-puppet/vagrantconfig.yaml2
4 files changed, 30 insertions, 13 deletions
diff --git a/bigtop-deploy/vm/docker-puppet/README.md b/bigtop-deploy/vm/docker-puppet/README.md
index abc64b6e..7848571a 100644
--- a/bigtop-deploy/vm/docker-puppet/README.md
+++ b/bigtop-deploy/vm/docker-puppet/README.md
@@ -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.
diff --git a/bigtop-deploy/vm/docker-puppet/docker-hadoop.sh b/bigtop-deploy/vm/docker-puppet/docker-hadoop.sh
index 4aff91c8..4b504b32 100755
--- a/bigtop-deploy/vm/docker-puppet/docker-hadoop.sh
+++ b/bigtop-deploy/vm/docker-puppet/docker-hadoop.sh
@@ -20,21 +20,22 @@ 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
@@ -42,7 +43,7 @@ create() {
}
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
@@ -50,20 +51,35 @@ provision() {
}
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
diff --git a/bigtop-deploy/vm/docker-puppet/provision.sh b/bigtop-deploy/vm/docker-puppet/provision.sh
index 670c6c64..da087c60 100755
--- a/bigtop-deploy/vm/docker-puppet/provision.sh
+++ b/bigtop-deploy/vm/docker-puppet/provision.sh
@@ -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
diff --git a/bigtop-deploy/vm/docker-puppet/vagrantconfig.yaml b/bigtop-deploy/vm/docker-puppet/vagrantconfig.yaml
index e1aac7a3..6a53d020 100644
--- a/bigtop-deploy/vm/docker-puppet/vagrantconfig.yaml
+++ b/bigtop-deploy/vm/docker-puppet/vagrantconfig.yaml
@@ -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"