Updated Branches: refs/heads/master 9138ca51f -> 91d73d5c6
BIGTOP-1171. Puppetize the Vagrant deployer Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/91d73d5c Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/91d73d5c Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/91d73d5c Branch: refs/heads/master Commit: 91d73d5c640d201ef9a149bea5cf2a0f8bdf615a Parents: 9138ca5 Author: evans_ye <[email protected]> Authored: Tue Jan 7 02:10:55 2014 +0800 Committer: Sean Mackrory <[email protected]> Committed: Mon Jan 20 12:54:08 2014 -0800 ---------------------------------------------------------------------- bigtop-deploy/vm/vagrant-puppet/README | 16 ++++++++ bigtop-deploy/vm/vagrant-puppet/Vagrantfile | 47 ++++++++++++++++++++++ bigtop-deploy/vm/vagrant-puppet/hbase-test.sh | 9 +++++ bigtop-deploy/vm/vagrant-puppet/provision.sh | 14 +++++++ 4 files changed, 86 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bigtop/blob/91d73d5c/bigtop-deploy/vm/vagrant-puppet/README ---------------------------------------------------------------------- diff --git a/bigtop-deploy/vm/vagrant-puppet/README b/bigtop-deploy/vm/vagrant-puppet/README new file mode 100644 index 0000000..819ce0b --- /dev/null +++ b/bigtop-deploy/vm/vagrant-puppet/README @@ -0,0 +1,16 @@ +Set up a vagrant box with bigtop ecosystem deployed by puppet + +Usage: + +1) Choose the ecosystem you want to be deployed by modify the components in provision.sh: + + components,hadoop,hbase,... + + By default, hadoop and hbase will be installed. + See bigtop-deploy/puppet/config/site.csv.example for more details. + + +2) vagrant up + + +3) Run hbase-test.sh to evaluate the deployment. http://git-wip-us.apache.org/repos/asf/bigtop/blob/91d73d5c/bigtop-deploy/vm/vagrant-puppet/Vagrantfile ---------------------------------------------------------------------- diff --git a/bigtop-deploy/vm/vagrant-puppet/Vagrantfile b/bigtop-deploy/vm/vagrant-puppet/Vagrantfile new file mode 100755 index 0000000..d852253 --- /dev/null +++ b/bigtop-deploy/vm/vagrant-puppet/Vagrantfile @@ -0,0 +1,47 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +VAGRANTFILE_API_VERSION = "2" +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + vmbox = "puppetlab-centos-64-nocm" + + # Virtual Box implementation + vmboxurl = "http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box" + + hostname = "vagrant.bigtop1" + + # The bigtop puppet recipes + bigtop_puppet = "../../puppet" + + # First node in the cluster + config.vm.define :bigtop1 do |bigtop1| + + bigtop1.vm.box = vmbox + bigtop1.vm.box_url = vmboxurl + + bigtop1.vm.provider :virtualbox do |vb| + vb.customize ["modifyvm", :id, "--memory", "1024"] + end + + bigtop1.vm.network :private_network, ip: "10.10.10.12" + bigtop1.vm.hostname = hostname + + bigtop1.vm.synced_folder bigtop_puppet, "/bigtop-puppet" + + # Shell provisioner to setup basic vm environment + bigtop1.vm.provision :shell do |shell| + shell.path = "provision.sh" + shell.args = hostname + end + + # Deploy hadoop and it's ecosystem + bigtop1.vm.provision :puppet do |puppet| + puppet.module_path = bigtop_puppet + "/modules" + puppet.manifests_path = bigtop_puppet + "/manifests" + puppet.manifest_file = "site.pp" + puppet.options = "--debug --confdir=/bigtop-puppet" + end + + end + +end http://git-wip-us.apache.org/repos/asf/bigtop/blob/91d73d5c/bigtop-deploy/vm/vagrant-puppet/hbase-test.sh ---------------------------------------------------------------------- diff --git a/bigtop-deploy/vm/vagrant-puppet/hbase-test.sh b/bigtop-deploy/vm/vagrant-puppet/hbase-test.sh new file mode 100755 index 0000000..c4820b8 --- /dev/null +++ b/bigtop-deploy/vm/vagrant-puppet/hbase-test.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +vagrant ssh -c "hbase shell <<EOF +create 't1','cf1' +put 't1', 'row1', 'cf1:q1', 'value1' +scan 't1' +disable 't1' +drop 't1' +EOF" http://git-wip-us.apache.org/repos/asf/bigtop/blob/91d73d5c/bigtop-deploy/vm/vagrant-puppet/provision.sh ---------------------------------------------------------------------- diff --git a/bigtop-deploy/vm/vagrant-puppet/provision.sh b/bigtop-deploy/vm/vagrant-puppet/provision.sh new file mode 100755 index 0000000..6219470 --- /dev/null +++ b/bigtop-deploy/vm/vagrant-puppet/provision.sh @@ -0,0 +1,14 @@ +# Install puppet agent +yum -y install http://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm +yum -y install puppet-2.7.23-1.el6.noarch + +# Prepare puppet configuration file +cat > /bigtop-puppet/config/site.csv << EOF +hadoop_head_node,$1 +hadoop_storage_dirs,/data/1,/data/2 +bigtop_yumrepo_uri,http://bigtop.s3.amazonaws.com/releases/0.7.0/redhat/6/x86_64 +jdk_package_name,java-1.7.0-openjdk-devel.x86_64 +components,hadoop,hbase +EOF + +mkdir -p /data/{1,2}
