SlideShare a Scribd company logo
Vagrantfile for Cloudera 5.3 Hadoop distribution
$master_script = <<SCRIPT
#!/bin/bash
# This script will execute for master node
echo `date` Setting up keys for root
# Copy ssh key from your repository to vm machine
# Below is the example
mkdir /root/.ssh
wget 192.168.2.177/testbed/keys/id_rsa -O /root/.ssh/id_rsa
wget 192.168.2.177/testbed/keys/id_rsa.pub -O /root/.ssh/id_rsa.pub
wget 192.168.2.177/testbed/keys/authorized_keys -O /root/.ssh/authorized_keys
chmod 600 -R /root/.ssh
apt-get install curl -y
REPOCM=${REPOCM:-cm5.3}
CM_REPO_HOST=${CM_REPO_HOST:-archive.cloudera.com}
CM_MAJOR_VERSION=$(echo $REPOCM| sed -e 's/cm([0-9]).*/1/')
CM_VERSION=$(echo $REPOCM | sed -e 's/cm([0-9][0-9]*)/1/')
OS_CODENAME=$(lsb_release -sc)
OS_DISTID=$(lsb_release -si | tr '[A-Z]' '[a-z]')
if [ $CM_MAJOR_VERSION -ge 4 ]; then
cat > /etc/apt/sources.list.d/cloudera-$REPOCM.list <<EOF
deb [arch=amd64]
http://$CM_REPO_HOST/cm$CM_MAJOR_VERSION/$OS_DISTID/$OS_CODENAME/amd64/
cm $OS_CODENAME-$REPOCMcontrib
deb-src
http://$CM_REPO_HOST/cm$CM_MAJOR_VERSION/$OS_DISTID/$OS_CODENAME/amd64/
cm $OS_CODENAME-$REPOCMcontrib
EOF
curl -s
http://$CM_REPO_HOST/cm$CM_MAJOR_VERSION/$OS_DISTID/$OS_CODENAME/amd64/
cm/archive.key > key
apt-key add key
rm key
fi
apt-get update
export DEBIAN_FRONTEND=noninteractive
# Download Cloudera packages
apt-get -q -y --force-yes install oracle-j2sdk1.7 cloudera-manager-server-db cloudera-
manager-server cloudera-manager-daemons
service cloudera-scm-server-db initdb
service cloudera-scm-server-db start
service cloudera-scm-server start
SCRIPT
$hosts_script = <<SCRIPT
# This script will execute on all nodes
echo `date` Setting up keys for root
mkdir /root/.ssh
wget 192.168.2.177/testbed/keys/id_rsa -O /root/.ssh/id_rsa
wget 192.168.2.177/testbed/keys/id_rsa.pub -O /root/.ssh/id_rsa.pub
wget 192.168.2.177/testbed/keys/authorized_keys -O /root/.ssh/authorized_keys
chmod 600 -R /root/.ssh
cat > /etc/hosts <<EOF
127.0.0.1 localhost
10.211.55.100 vm-cdh-node1.test.com
10.211.55.101 vm-cdh-node2.test.com
10.211.55.102 vm-cdh-node3.test.com
10.211.55.103 vm-cdh-node4.test.com
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
EOF
SCRIPT
Vagrant.configure("2") do |config|
# Define base image
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
# Manage /etc/hosts on host and VMs
# config.hostmanager.enabled = false
# config.hostmanager.manage_host = true
# config.hostmanager.include_offline = true
# config.hostmanager.ignore_private_ip = false
config.vm.define :master do |master|
master.vm.provider :virtualbox do |v|
v.name = "vm-cdh-node1"
v.customize ["modifyvm", :id, "--memory", "8192"]
end
master.vm.network :private_network, ip: "10.211.55.100"
master.vm.network :forwarded_port, guest: 9090, host: 9091
master.vm.hostname = "vm-cdh-node1.test.com"
master.vm.provision :shell, :inline => $hosts_script
# master.vm.provision :hostmanager
master.vm.provision :shell, :inline => $master_script
end
config.vm.define :slave1 do |slave1|
slave1.vm.box = "precise64"
slave1.vm.provider :virtualbox do |v|
v.name = "vm-cdh-node2"
v.customize ["modifyvm", :id, "--memory", "8192"]
end
slave1.vm.network :private_network, ip: "10.211.55.101"
slave1.vm.hostname = "vm-cdh-node2.test.com"
slave1.vm.provision :shell, :inline => $hosts_script
# slave1.vm.provision :hostmanager
end
config.vm.define :slave2 do |slave2|
slave2.vm.box = "precise64"
slave2.vm.provider :virtualbox do |v|
v.name = "vm-cdh-node3"
v.customize ["modifyvm", :id, "--memory", "8192"]
end
slave2.vm.network :private_network, ip: "10.211.55.102"
slave2.vm.hostname = "vm-cdh-node3.test.com"
slave2.vm.provision :shell, :inline => $hosts_script
# slave2.vm.provision :hostmanager
end
config.vm.define :slave3 do |slave3|
slave3.vm.box = "precise64"
slave3.vm.provider :virtualbox do |v|
v.name = "vm-cdh-node4"
v.customize ["modifyvm", :id, "--memory", "8192"]
end
slave3.vm.network :private_network, ip: "10.211.55.103"
slave3.vm.hostname = "vm-cdh-node4.test.com"
slave3.vm.provision :shell, :inline => $hosts_script
# slave3.vm.provision :hostmanager
end
end
Vagrantfile for HDP 2.2 Hadoop distribution
$master_script = <<SCRIPT
#!/bin/bash
echo `date` Setting up keys for root
mkdir /root/.ssh
wget 192.168.2.177/testbed/keys/id_rsa -O /root/.ssh/id_rsa
wget 192.168.2.177/testbed/keys/id_rsa.pub -O /root/.ssh/id_rsa.pub
wget 192.168.2.177/testbed/keys/authorized_keys -O /root/.ssh/authorized_keys
chmod 600 -R /root/.ssh
#apt-get install curl -y
# Download and move the Ambari repo bits to /etc/yum.repos.d
#wget http://public-repo-
1.hortonworks.com/ambari/centos6/2.x/updates/2.0.0/ambari.repo
#mv ambari.repo /etc/yum/repos.d
cd /etc/apt/sources.list.d
sudo wget http://public-repo-
1.hortonworks.com/ambari/ubuntu12/2.x/updates/2.0.0/ambari.list
#Check repo has been configured correctly
#yum repolist
#Install Ambari
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B9733A7A07513CAD
sudo apt-get update
sudo apt-get -q -y install ambari-server
#Default configuration
ambari-server setup -s
#Spin up Ambari
ambari-server start
SCRIPT
$hosts_script = <<SCRIPT
sudo apt-get -q -y install wget
sudo apt-get -q -y install ntp
#sudo service ntp status
echo `date` Setting up keys for root
mkdir /root/.ssh
wget 192.168.2.177/testbed/keys/id_rsa -O /root/.ssh/id_rsa
wget 192.168.2.177/testbed/keys/id_rsa.pub -O /root/.ssh/id_rsa.pub
wget 192.168.2.177/testbed/keys/authorized_keys -O /root/.ssh/authorized_keys
chmod 600 -R /root/.ssh
cat > /etc/hosts <<EOF
127.0.0.1 localhost
10.211.55.105 vm-hdp-node1
10.211.55.106 vm-hdp-node2
10.211.55.107 vm-hdp-node3
10.211.55.108 vm-hdp-node4
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
EOF
SCRIPT
Vagrant.configure("2") do |config|
# Define base image
config.vm.box = "precise64"
config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/precise/current/precise-
server-cloudimg-amd64-vagrant-disk1.box"
# Manage /etc/hosts on host and VMs
# config.hostmanager.enabled = false
# config.hostmanager.manage_host = true
# config.hostmanager.include_offline = true
# config.hostmanager.ignore_private_ip = false
config.vm.define :master do |master|
master.vm.provider :virtualbox do |v|
v.name = "vm-hdp-node1"
v.customize ["modifyvm", :id, "--memory", "32768"]
end
master.vm.network :private_network, ip: "10.211.55.105"
# master.vm.network :forwarded_port, guest: 9090, host: 9091
master.vm.hostname = "vm-hdp-node1"
master.vm.provision :shell, :inline => $hosts_script
# master.vm.provision :hostmanager
master.vm.provision :shell, :inline => $master_script
end
config.vm.define :slave1 do |slave1|
slave1.vm.box = "precise64"
slave1.vm.provider :virtualbox do |v|
v.name = "vm-hdp-node2"
v.customize ["modifyvm", :id, "--memory", "32768"]
end
slave1.vm.network :private_network, ip: "10.211.55.106"
slave1.vm.hostname = "vm-hdp-node2"
slave1.vm.provision :shell, :inline => $hosts_script
# slave1.vm.provision :hostmanager
end
config.vm.define :slave2 do |slave2|
slave2.vm.box = "precise64"
slave2.vm.provider :virtualbox do |v|
v.name = "vm-hdp-node3"
v.customize ["modifyvm", :id, "--memory", "32768"]
end
slave2.vm.network :private_network, ip: "10.211.55.107"
slave2.vm.hostname = "vm-hdp-node3"
slave2.vm.provision :shell, :inline => $hosts_script
# slave2.vm.provision :hostmanager
end
config.vm.define :slave3 do |slave3|
slave3.vm.box = "precise64"
slave3.vm.provider :virtualbox do |v|
v.name = "vm-hdp-node4"
v.customize ["modifyvm", :id, "--memory", "32768"]
end
slave3.vm.network :private_network, ip: "10.211.55.108"
slave3.vm.hostname = "vm-hdp-node4"
slave3.vm.provision :shell, :inline => $hosts_script
# slave3.vm.provision :hostmanager
end
end
Vagrantfile for MAPR Hadoop distribution
$master_script = <<SCRIPT
#!/bin/bash
#Download MAPR installer
#
mkdir -p mapr-installer
cd mapr-installer
wget http://package.mapr.com/releases/installer/mapr-setup.sh
sudo sh mapr-setup.sh -y install
SCRIPT
$hosts_script = <<SCRIPT
sudo apt-get -q -y install wget
#sudo service ntp status
echo `date` Setting up keys for root
mkdir /root/.ssh
wget 192.168.2.177/testbed/keys/id_rsa -O /root/.ssh/id_rsa
wget 192.168.2.177/testbed/keys/id_rsa.pub -O /root/.ssh/id_rsa.pub
wget 192.168.2.177/testbed/keys/authorized_keys -O /root/.ssh/authorized_keys
chmod 600 -R /root/.ssh
cat > /etc/hosts <<EOF
127.0.0.1 localhost
10.211.55.108 mapr-node1
10.211.55.109 mapr-node2
10.211.55.110 mapr-node3
10.211.55.111 mapr-node4
10.211.55.112 mapr-node5
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
EOF
SCRIPT
Vagrant.configure("2") do |config|
# Define base image
config.vm.box = "precise64"
config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/precise/current/precise-
server-cloudimg-amd64-vagrant-disk1.box"
# Manage /etc/hosts on host and VMs
# config.hostmanager.enabled = false
# config.hostmanager.manage_host = true
# config.hostmanager.include_offline = true
# config.hostmanager.ignore_private_ip = false
config.vm.define :master do |master|
master.vm.provider :virtualbox do |v|
v.name = "mapr-node1"
v.customize ["modifyvm", :id, "--memory", "32768"]
unless File.exist?('datadisk1.vdi')
v.customize ['createhd', '--filename', 'datadisk1.vdi', '--size', 50 * 1024]
end
v.customize ['storageattach', :id, '--storagectl', 'SATAController', '--port', 1, '--
device', 0, '--type', 'hdd', '--medium', 'datadisk1.vdi']
end
master.vm.network :private_network, ip: "10.211.55.108"
master.vm.hostname = "mapr-node1"
master.vm.network "forwarded_port", guest: 9443, host: 9443
master.vm.network "forwarded_port", guest: 22, host: 9444
master.vm.provision :shell, :inline => $hosts_script
master.vm.provision :shell, :inline => $master_script
end
config.vm.define :slave1 do |slave1|
slave1.vm.box = "precise64"
slave1.vm.provider :virtualbox do |v|
v.name = "mapr-node2"
v.customize ["modifyvm", :id, "--memory", "32768"]
unless File.exist?('datadisk2.vdi')
v.customize ['createhd', '--filename', 'datadisk2.vdi', '--size', 50 * 1024]
end
v.customize ['storageattach', :id, '--storagectl', 'SATAController', '--port', 1, '--
device', 0, '--type', 'hdd', '--medium', 'datadisk2.vdi']
end
slave1.vm.network :private_network, ip: "10.211.55.109"
slave1.vm.hostname = "mapr-node2"
slave1.vm.provision :shell, :inline => $hosts_script
end
config.vm.define :slave2 do |slave2|
slave2.vm.box = "precise64"
slave2.vm.provider :virtualbox do |v|
v.name = "mapr-node3"
v.customize ["modifyvm", :id, "--memory", "32768"]
unless File.exist?('datadisk3.vdi')
v.customize ['createhd', '--filename', 'datadisk3.vdi', '--size', 50 * 1024]
end
v.customize ['storageattach', :id, '--storagectl', 'SATAController', '--port', 1, '--
device', 0, '--type', 'hdd', '--medium', 'datadisk3.vdi']
end
slave2.vm.network :private_network, ip: "10.211.55.110"
slave2.vm.hostname = "mapr-node3"
slave2.vm.provision :shell, :inline => $hosts_script
end
config.vm.define :slave3 do |slave3|
slave3.vm.box = "precise64"
slave3.vm.provider :virtualbox do |v|
v.name = "mapr-node4"
v.customize ["modifyvm", :id, "--memory", "32768"]
unless File.exist?('datadisk4.vdi')
v.customize ['createhd', '--filename', 'datadisk4.vdi', '--size', 50 * 1024]
end
v.customize ['storageattach', :id, '--storagectl', 'SATAController', '--port', 1, '--
device', 0, '--type', 'hdd', '--medium', 'datadisk4.vdi']
end
slave3.vm.network :private_network, ip: "10.211.55.111"
slave3.vm.hostname = "mapr-node4"
slave3.vm.provision :shell, :inline => $hosts_script
end
config.vm.define :slave4 do |slave4|
slave4.vm.box = "precise64"
slave4.vm.provider :virtualbox do |v|
v.name = "mapr-node5"
v.customize ["modifyvm", :id, "--memory", "32768"]
unless File.exist?('datadisk5.vdi')
v.customize ['createhd', '--filename', 'datadisk5.vdi', '--size', 50 * 1024]
end
v.customize ['storageattach', :id, '--storagectl', 'SATAController', '--port', 1, '--
device', 0, '--type', 'hdd', '--medium', 'datadisk5.vdi']
end
slave4.vm.network :private_network, ip: "10.211.55.112"
slave4.vm.hostname = "mapr-node5"
slave4.vm.provision :shell, :inline => $hosts_script
end
end
Vagrant file samples for various Hadoop distributions

More Related Content

What's hot

How we use and deploy Varnish at Opera
How we use and deploy Varnish at OperaHow we use and deploy Varnish at Opera
How we use and deploy Varnish at Opera
Cosimo Streppone
 
Efficient DBA: Gain Time by Reducing Command-Line Keystrokes
Efficient DBA: Gain Time by Reducing Command-Line KeystrokesEfficient DBA: Gain Time by Reducing Command-Line Keystrokes
Efficient DBA: Gain Time by Reducing Command-Line Keystrokes
Seth Miller
 
Testing your infrastructure with litmus
Testing your infrastructure with litmusTesting your infrastructure with litmus
Testing your infrastructure with litmus
Bram Vogelaar
 
Ansible fest Presentation slides
Ansible fest Presentation slidesAnsible fest Presentation slides
Ansible fest Presentation slides
Aaron Carey
 
Deploying Plone and Volto, the Hard Way
Deploying Plone and Volto, the Hard WayDeploying Plone and Volto, the Hard Way
Deploying Plone and Volto, the Hard Way
Asko Soukka
 
How to go the extra mile on monitoring
How to go the extra mile on monitoringHow to go the extra mile on monitoring
How to go the extra mile on monitoring
Tiago Simões
 
ZeroMQ Is The Answer: PHP Tek 11 Version
ZeroMQ Is The Answer: PHP Tek 11 VersionZeroMQ Is The Answer: PHP Tek 11 Version
ZeroMQ Is The Answer: PHP Tek 11 Version
Ian Barber
 
How to create a secured multi tenancy for clustered ML with JupyterHub
How to create a secured multi tenancy for clustered ML with JupyterHubHow to create a secured multi tenancy for clustered ML with JupyterHub
How to create a secured multi tenancy for clustered ML with JupyterHub
Tiago Simões
 
Introduction To Moco
Introduction To MocoIntroduction To Moco
Introduction To MocoNaoya Ito
 
Node.js API 서버 성능 개선기
Node.js API 서버 성능 개선기Node.js API 서버 성능 개선기
Node.js API 서버 성능 개선기
JeongHun Byeon
 
Asynchronous PHP and Real-time Messaging
Asynchronous PHP and Real-time MessagingAsynchronous PHP and Real-time Messaging
Asynchronous PHP and Real-time Messaging
Steve Rhoades
 
VUG5: Varnish at Opera Software
VUG5: Varnish at Opera SoftwareVUG5: Varnish at Opera Software
VUG5: Varnish at Opera Software
Cosimo Streppone
 
ZeroMQ Is The Answer
ZeroMQ Is The AnswerZeroMQ Is The Answer
ZeroMQ Is The Answer
Ian Barber
 
Top Node.js Metrics to Watch
Top Node.js Metrics to WatchTop Node.js Metrics to Watch
Top Node.js Metrics to Watch
Sematext Group, Inc.
 
Ansible leveraging 2.0
Ansible leveraging 2.0Ansible leveraging 2.0
Ansible leveraging 2.0
bcoca
 
Autoscaling with hashi_corp_nomad
Autoscaling with hashi_corp_nomadAutoscaling with hashi_corp_nomad
Autoscaling with hashi_corp_nomad
Bram Vogelaar
 
Ansible, voyage au centre de l'automatisation
Ansible, voyage au centre de l'automatisationAnsible, voyage au centre de l'automatisation
Ansible, voyage au centre de l'automatisation
Mickael Hubert
 
Network Automation: Ansible 102
Network Automation: Ansible 102Network Automation: Ansible 102
Network Automation: Ansible 102
APNIC
 
"Ops Tools with Perl" 2012/05/12 Hokkaido.pm
"Ops Tools with Perl" 2012/05/12 Hokkaido.pm"Ops Tools with Perl" 2012/05/12 Hokkaido.pm
"Ops Tools with Perl" 2012/05/12 Hokkaido.pmRyosuke IWANAGA
 

What's hot (20)

How we use and deploy Varnish at Opera
How we use and deploy Varnish at OperaHow we use and deploy Varnish at Opera
How we use and deploy Varnish at Opera
 
Efficient DBA: Gain Time by Reducing Command-Line Keystrokes
Efficient DBA: Gain Time by Reducing Command-Line KeystrokesEfficient DBA: Gain Time by Reducing Command-Line Keystrokes
Efficient DBA: Gain Time by Reducing Command-Line Keystrokes
 
Testing your infrastructure with litmus
Testing your infrastructure with litmusTesting your infrastructure with litmus
Testing your infrastructure with litmus
 
Ansible fest Presentation slides
Ansible fest Presentation slidesAnsible fest Presentation slides
Ansible fest Presentation slides
 
Deploying Plone and Volto, the Hard Way
Deploying Plone and Volto, the Hard WayDeploying Plone and Volto, the Hard Way
Deploying Plone and Volto, the Hard Way
 
How to go the extra mile on monitoring
How to go the extra mile on monitoringHow to go the extra mile on monitoring
How to go the extra mile on monitoring
 
ZeroMQ Is The Answer: PHP Tek 11 Version
ZeroMQ Is The Answer: PHP Tek 11 VersionZeroMQ Is The Answer: PHP Tek 11 Version
ZeroMQ Is The Answer: PHP Tek 11 Version
 
How to create a secured multi tenancy for clustered ML with JupyterHub
How to create a secured multi tenancy for clustered ML with JupyterHubHow to create a secured multi tenancy for clustered ML with JupyterHub
How to create a secured multi tenancy for clustered ML with JupyterHub
 
Introduction To Moco
Introduction To MocoIntroduction To Moco
Introduction To Moco
 
Node.js API 서버 성능 개선기
Node.js API 서버 성능 개선기Node.js API 서버 성능 개선기
Node.js API 서버 성능 개선기
 
Asynchronous PHP and Real-time Messaging
Asynchronous PHP and Real-time MessagingAsynchronous PHP and Real-time Messaging
Asynchronous PHP and Real-time Messaging
 
VUG5: Varnish at Opera Software
VUG5: Varnish at Opera SoftwareVUG5: Varnish at Opera Software
VUG5: Varnish at Opera Software
 
How-to Integração Postfi
How-to Integração PostfiHow-to Integração Postfi
How-to Integração Postfi
 
ZeroMQ Is The Answer
ZeroMQ Is The AnswerZeroMQ Is The Answer
ZeroMQ Is The Answer
 
Top Node.js Metrics to Watch
Top Node.js Metrics to WatchTop Node.js Metrics to Watch
Top Node.js Metrics to Watch
 
Ansible leveraging 2.0
Ansible leveraging 2.0Ansible leveraging 2.0
Ansible leveraging 2.0
 
Autoscaling with hashi_corp_nomad
Autoscaling with hashi_corp_nomadAutoscaling with hashi_corp_nomad
Autoscaling with hashi_corp_nomad
 
Ansible, voyage au centre de l'automatisation
Ansible, voyage au centre de l'automatisationAnsible, voyage au centre de l'automatisation
Ansible, voyage au centre de l'automatisation
 
Network Automation: Ansible 102
Network Automation: Ansible 102Network Automation: Ansible 102
Network Automation: Ansible 102
 
"Ops Tools with Perl" 2012/05/12 Hokkaido.pm
"Ops Tools with Perl" 2012/05/12 Hokkaido.pm"Ops Tools with Perl" 2012/05/12 Hokkaido.pm
"Ops Tools with Perl" 2012/05/12 Hokkaido.pm
 

Viewers also liked

BillLeeQualifications4-23
BillLeeQualifications4-23BillLeeQualifications4-23
BillLeeQualifications4-23Bill Lee
 
ΟΛΥΜΠΙΑΚΟΙ ΑΓΩΝΕΣ β
ΟΛΥΜΠΙΑΚΟΙ ΑΓΩΝΕΣ   βΟΛΥΜΠΙΑΚΟΙ ΑΓΩΝΕΣ   β
ΟΛΥΜΠΙΑΚΟΙ ΑΓΩΝΕΣ β
ANTONOPOULOU HELEN
 
Electiva
ElectivaElectiva
Electiva
Luisa Jaramillo
 
Salterbaxter Campaignable Reporting 2017
Salterbaxter Campaignable Reporting 2017Salterbaxter Campaignable Reporting 2017
Salterbaxter Campaignable Reporting 2017Samuel Griffin-Flynn
 
Terhi Koskentausta, lääkityksen rooli kokonaishoidossa, Autismin talvipäivät ...
Terhi Koskentausta, lääkityksen rooli kokonaishoidossa, Autismin talvipäivät ...Terhi Koskentausta, lääkityksen rooli kokonaishoidossa, Autismin talvipäivät ...
Terhi Koskentausta, lääkityksen rooli kokonaishoidossa, Autismin talvipäivät ...
Autismiliitto
 
Lance Ng - B2C Growth Hacking in Singapore (Searix Solutions)
Lance Ng - B2C Growth Hacking in Singapore (Searix Solutions)Lance Ng - B2C Growth Hacking in Singapore (Searix Solutions)
Lance Ng - B2C Growth Hacking in Singapore (Searix Solutions)
Lance Li Sheng
 
Canteen user survey format - Developed by Arunesh Chand Mankotia
Canteen user survey format - Developed by Arunesh Chand MankotiaCanteen user survey format - Developed by Arunesh Chand Mankotia
Canteen user survey format - Developed by Arunesh Chand Mankotia
Consultonmic
 
Ourlife
OurlifeOurlife

Viewers also liked (10)

BillLeeQualifications4-23
BillLeeQualifications4-23BillLeeQualifications4-23
BillLeeQualifications4-23
 
Resume
ResumeResume
Resume
 
ΟΛΥΜΠΙΑΚΟΙ ΑΓΩΝΕΣ β
ΟΛΥΜΠΙΑΚΟΙ ΑΓΩΝΕΣ   βΟΛΥΜΠΙΑΚΟΙ ΑΓΩΝΕΣ   β
ΟΛΥΜΠΙΑΚΟΙ ΑΓΩΝΕΣ β
 
Electiva
ElectivaElectiva
Electiva
 
Thesis Zhengdi Wang
Thesis Zhengdi WangThesis Zhengdi Wang
Thesis Zhengdi Wang
 
Salterbaxter Campaignable Reporting 2017
Salterbaxter Campaignable Reporting 2017Salterbaxter Campaignable Reporting 2017
Salterbaxter Campaignable Reporting 2017
 
Terhi Koskentausta, lääkityksen rooli kokonaishoidossa, Autismin talvipäivät ...
Terhi Koskentausta, lääkityksen rooli kokonaishoidossa, Autismin talvipäivät ...Terhi Koskentausta, lääkityksen rooli kokonaishoidossa, Autismin talvipäivät ...
Terhi Koskentausta, lääkityksen rooli kokonaishoidossa, Autismin talvipäivät ...
 
Lance Ng - B2C Growth Hacking in Singapore (Searix Solutions)
Lance Ng - B2C Growth Hacking in Singapore (Searix Solutions)Lance Ng - B2C Growth Hacking in Singapore (Searix Solutions)
Lance Ng - B2C Growth Hacking in Singapore (Searix Solutions)
 
Canteen user survey format - Developed by Arunesh Chand Mankotia
Canteen user survey format - Developed by Arunesh Chand MankotiaCanteen user survey format - Developed by Arunesh Chand Mankotia
Canteen user survey format - Developed by Arunesh Chand Mankotia
 
Ourlife
OurlifeOurlife
Ourlife
 

Similar to Vagrant file samples for various Hadoop distributions

Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))
Michele Orselli
 
Intro to vagrant
Intro to vagrantIntro to vagrant
Intro to vagrant
Mantas Klasavicius
 
Minicurso de Vagrant
Minicurso de VagrantMinicurso de Vagrant
Minicurso de Vagrant
Leandro Nunes
 
Vagrant for real
Vagrant for realVagrant for real
Vagrant for real
Codemotion
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)
Michele Orselli
 
Software Defined Datacenter
Software Defined DatacenterSoftware Defined Datacenter
Software Defined Datacenter
NETWAYS
 
X64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 newX64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 newYiwei Ma
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slidesharetomcopeland
 
Docker remote-api
Docker remote-apiDocker remote-api
Docker remote-api
Eric Ahn
 
Environments line-up! Vagrant & Puppet 101
Environments line-up! Vagrant & Puppet 101Environments line-up! Vagrant & Puppet 101
Environments line-up! Vagrant & Puppet 101jelrikvh
 
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
Willian Molinari
 
Automating the Network
Automating the NetworkAutomating the Network
Automating the Network
Puppet
 
Vagrant for real
Vagrant for realVagrant for real
Vagrant for real
Michele Orselli
 
Facebook的缓存系统
Facebook的缓存系统Facebook的缓存系统
Facebook的缓存系统yiditushe
 
Introduction to CloudForecast / YAPC::Asia 2010 Tokyo
Introduction to CloudForecast / YAPC::Asia 2010 TokyoIntroduction to CloudForecast / YAPC::Asia 2010 Tokyo
Introduction to CloudForecast / YAPC::Asia 2010 TokyoMasahiro Nagano
 
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
raccoony
 
Puppet @ Seat
Puppet @ SeatPuppet @ Seat
Puppet @ Seat
Alessandro Franceschi
 
Ubic-public
Ubic-publicUbic-public

Similar to Vagrant file samples for various Hadoop distributions (20)

EC2
EC2EC2
EC2
 
Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))
 
Intro to vagrant
Intro to vagrantIntro to vagrant
Intro to vagrant
 
Minicurso de Vagrant
Minicurso de VagrantMinicurso de Vagrant
Minicurso de Vagrant
 
Vagrant for real
Vagrant for realVagrant for real
Vagrant for real
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)
 
Software Defined Datacenter
Software Defined DatacenterSoftware Defined Datacenter
Software Defined Datacenter
 
X64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 newX64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 new
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshare
 
Docker remote-api
Docker remote-apiDocker remote-api
Docker remote-api
 
Environments line-up! Vagrant & Puppet 101
Environments line-up! Vagrant & Puppet 101Environments line-up! Vagrant & Puppet 101
Environments line-up! Vagrant & Puppet 101
 
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
 
Automating the Network
Automating the NetworkAutomating the Network
Automating the Network
 
Vagrant for real
Vagrant for realVagrant for real
Vagrant for real
 
Facebook的缓存系统
Facebook的缓存系统Facebook的缓存系统
Facebook的缓存系统
 
Introduction to CloudForecast / YAPC::Asia 2010 Tokyo
Introduction to CloudForecast / YAPC::Asia 2010 TokyoIntroduction to CloudForecast / YAPC::Asia 2010 Tokyo
Introduction to CloudForecast / YAPC::Asia 2010 Tokyo
 
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
 
Puppet @ Seat
Puppet @ SeatPuppet @ Seat
Puppet @ Seat
 
Ubic
UbicUbic
Ubic
 
Ubic-public
Ubic-publicUbic-public
Ubic-public
 

Recently uploaded

NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 

Recently uploaded (20)

NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 

Vagrant file samples for various Hadoop distributions

  • 1. Vagrantfile for Cloudera 5.3 Hadoop distribution $master_script = <<SCRIPT #!/bin/bash # This script will execute for master node echo `date` Setting up keys for root # Copy ssh key from your repository to vm machine # Below is the example mkdir /root/.ssh wget 192.168.2.177/testbed/keys/id_rsa -O /root/.ssh/id_rsa wget 192.168.2.177/testbed/keys/id_rsa.pub -O /root/.ssh/id_rsa.pub wget 192.168.2.177/testbed/keys/authorized_keys -O /root/.ssh/authorized_keys chmod 600 -R /root/.ssh apt-get install curl -y REPOCM=${REPOCM:-cm5.3} CM_REPO_HOST=${CM_REPO_HOST:-archive.cloudera.com} CM_MAJOR_VERSION=$(echo $REPOCM| sed -e 's/cm([0-9]).*/1/') CM_VERSION=$(echo $REPOCM | sed -e 's/cm([0-9][0-9]*)/1/') OS_CODENAME=$(lsb_release -sc) OS_DISTID=$(lsb_release -si | tr '[A-Z]' '[a-z]') if [ $CM_MAJOR_VERSION -ge 4 ]; then cat > /etc/apt/sources.list.d/cloudera-$REPOCM.list <<EOF deb [arch=amd64] http://$CM_REPO_HOST/cm$CM_MAJOR_VERSION/$OS_DISTID/$OS_CODENAME/amd64/ cm $OS_CODENAME-$REPOCMcontrib deb-src http://$CM_REPO_HOST/cm$CM_MAJOR_VERSION/$OS_DISTID/$OS_CODENAME/amd64/ cm $OS_CODENAME-$REPOCMcontrib EOF curl -s http://$CM_REPO_HOST/cm$CM_MAJOR_VERSION/$OS_DISTID/$OS_CODENAME/amd64/ cm/archive.key > key apt-key add key rm key fi apt-get update export DEBIAN_FRONTEND=noninteractive # Download Cloudera packages apt-get -q -y --force-yes install oracle-j2sdk1.7 cloudera-manager-server-db cloudera- manager-server cloudera-manager-daemons service cloudera-scm-server-db initdb service cloudera-scm-server-db start service cloudera-scm-server start SCRIPT
  • 2. $hosts_script = <<SCRIPT # This script will execute on all nodes echo `date` Setting up keys for root mkdir /root/.ssh wget 192.168.2.177/testbed/keys/id_rsa -O /root/.ssh/id_rsa wget 192.168.2.177/testbed/keys/id_rsa.pub -O /root/.ssh/id_rsa.pub wget 192.168.2.177/testbed/keys/authorized_keys -O /root/.ssh/authorized_keys chmod 600 -R /root/.ssh cat > /etc/hosts <<EOF 127.0.0.1 localhost 10.211.55.100 vm-cdh-node1.test.com 10.211.55.101 vm-cdh-node2.test.com 10.211.55.102 vm-cdh-node3.test.com 10.211.55.103 vm-cdh-node4.test.com # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters EOF SCRIPT Vagrant.configure("2") do |config| # Define base image config.vm.box = "precise64" config.vm.box_url = "http://files.vagrantup.com/precise64.box" # Manage /etc/hosts on host and VMs # config.hostmanager.enabled = false # config.hostmanager.manage_host = true # config.hostmanager.include_offline = true # config.hostmanager.ignore_private_ip = false config.vm.define :master do |master| master.vm.provider :virtualbox do |v| v.name = "vm-cdh-node1" v.customize ["modifyvm", :id, "--memory", "8192"] end master.vm.network :private_network, ip: "10.211.55.100"
  • 3. master.vm.network :forwarded_port, guest: 9090, host: 9091 master.vm.hostname = "vm-cdh-node1.test.com" master.vm.provision :shell, :inline => $hosts_script # master.vm.provision :hostmanager master.vm.provision :shell, :inline => $master_script end config.vm.define :slave1 do |slave1| slave1.vm.box = "precise64" slave1.vm.provider :virtualbox do |v| v.name = "vm-cdh-node2" v.customize ["modifyvm", :id, "--memory", "8192"] end slave1.vm.network :private_network, ip: "10.211.55.101" slave1.vm.hostname = "vm-cdh-node2.test.com" slave1.vm.provision :shell, :inline => $hosts_script # slave1.vm.provision :hostmanager end config.vm.define :slave2 do |slave2| slave2.vm.box = "precise64" slave2.vm.provider :virtualbox do |v| v.name = "vm-cdh-node3" v.customize ["modifyvm", :id, "--memory", "8192"] end slave2.vm.network :private_network, ip: "10.211.55.102" slave2.vm.hostname = "vm-cdh-node3.test.com" slave2.vm.provision :shell, :inline => $hosts_script # slave2.vm.provision :hostmanager end config.vm.define :slave3 do |slave3| slave3.vm.box = "precise64" slave3.vm.provider :virtualbox do |v| v.name = "vm-cdh-node4" v.customize ["modifyvm", :id, "--memory", "8192"] end slave3.vm.network :private_network, ip: "10.211.55.103" slave3.vm.hostname = "vm-cdh-node4.test.com" slave3.vm.provision :shell, :inline => $hosts_script # slave3.vm.provision :hostmanager end end
  • 4. Vagrantfile for HDP 2.2 Hadoop distribution $master_script = <<SCRIPT #!/bin/bash echo `date` Setting up keys for root mkdir /root/.ssh wget 192.168.2.177/testbed/keys/id_rsa -O /root/.ssh/id_rsa wget 192.168.2.177/testbed/keys/id_rsa.pub -O /root/.ssh/id_rsa.pub wget 192.168.2.177/testbed/keys/authorized_keys -O /root/.ssh/authorized_keys chmod 600 -R /root/.ssh #apt-get install curl -y # Download and move the Ambari repo bits to /etc/yum.repos.d #wget http://public-repo- 1.hortonworks.com/ambari/centos6/2.x/updates/2.0.0/ambari.repo #mv ambari.repo /etc/yum/repos.d cd /etc/apt/sources.list.d sudo wget http://public-repo- 1.hortonworks.com/ambari/ubuntu12/2.x/updates/2.0.0/ambari.list #Check repo has been configured correctly #yum repolist #Install Ambari sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B9733A7A07513CAD sudo apt-get update sudo apt-get -q -y install ambari-server #Default configuration ambari-server setup -s #Spin up Ambari ambari-server start SCRIPT $hosts_script = <<SCRIPT sudo apt-get -q -y install wget sudo apt-get -q -y install ntp #sudo service ntp status echo `date` Setting up keys for root mkdir /root/.ssh
  • 5. wget 192.168.2.177/testbed/keys/id_rsa -O /root/.ssh/id_rsa wget 192.168.2.177/testbed/keys/id_rsa.pub -O /root/.ssh/id_rsa.pub wget 192.168.2.177/testbed/keys/authorized_keys -O /root/.ssh/authorized_keys chmod 600 -R /root/.ssh cat > /etc/hosts <<EOF 127.0.0.1 localhost 10.211.55.105 vm-hdp-node1 10.211.55.106 vm-hdp-node2 10.211.55.107 vm-hdp-node3 10.211.55.108 vm-hdp-node4 # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters EOF SCRIPT Vagrant.configure("2") do |config| # Define base image config.vm.box = "precise64" config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/precise/current/precise- server-cloudimg-amd64-vagrant-disk1.box" # Manage /etc/hosts on host and VMs # config.hostmanager.enabled = false # config.hostmanager.manage_host = true # config.hostmanager.include_offline = true # config.hostmanager.ignore_private_ip = false config.vm.define :master do |master| master.vm.provider :virtualbox do |v| v.name = "vm-hdp-node1" v.customize ["modifyvm", :id, "--memory", "32768"] end master.vm.network :private_network, ip: "10.211.55.105" # master.vm.network :forwarded_port, guest: 9090, host: 9091 master.vm.hostname = "vm-hdp-node1" master.vm.provision :shell, :inline => $hosts_script # master.vm.provision :hostmanager master.vm.provision :shell, :inline => $master_script end
  • 6. config.vm.define :slave1 do |slave1| slave1.vm.box = "precise64" slave1.vm.provider :virtualbox do |v| v.name = "vm-hdp-node2" v.customize ["modifyvm", :id, "--memory", "32768"] end slave1.vm.network :private_network, ip: "10.211.55.106" slave1.vm.hostname = "vm-hdp-node2" slave1.vm.provision :shell, :inline => $hosts_script # slave1.vm.provision :hostmanager end config.vm.define :slave2 do |slave2| slave2.vm.box = "precise64" slave2.vm.provider :virtualbox do |v| v.name = "vm-hdp-node3" v.customize ["modifyvm", :id, "--memory", "32768"] end slave2.vm.network :private_network, ip: "10.211.55.107" slave2.vm.hostname = "vm-hdp-node3" slave2.vm.provision :shell, :inline => $hosts_script # slave2.vm.provision :hostmanager end config.vm.define :slave3 do |slave3| slave3.vm.box = "precise64" slave3.vm.provider :virtualbox do |v| v.name = "vm-hdp-node4" v.customize ["modifyvm", :id, "--memory", "32768"] end slave3.vm.network :private_network, ip: "10.211.55.108" slave3.vm.hostname = "vm-hdp-node4" slave3.vm.provision :shell, :inline => $hosts_script # slave3.vm.provision :hostmanager end end
  • 7. Vagrantfile for MAPR Hadoop distribution $master_script = <<SCRIPT #!/bin/bash #Download MAPR installer # mkdir -p mapr-installer cd mapr-installer wget http://package.mapr.com/releases/installer/mapr-setup.sh sudo sh mapr-setup.sh -y install SCRIPT $hosts_script = <<SCRIPT sudo apt-get -q -y install wget #sudo service ntp status echo `date` Setting up keys for root mkdir /root/.ssh wget 192.168.2.177/testbed/keys/id_rsa -O /root/.ssh/id_rsa wget 192.168.2.177/testbed/keys/id_rsa.pub -O /root/.ssh/id_rsa.pub wget 192.168.2.177/testbed/keys/authorized_keys -O /root/.ssh/authorized_keys chmod 600 -R /root/.ssh cat > /etc/hosts <<EOF 127.0.0.1 localhost 10.211.55.108 mapr-node1 10.211.55.109 mapr-node2 10.211.55.110 mapr-node3 10.211.55.111 mapr-node4 10.211.55.112 mapr-node5 # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters EOF SCRIPT Vagrant.configure("2") do |config|
  • 8. # Define base image config.vm.box = "precise64" config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/precise/current/precise- server-cloudimg-amd64-vagrant-disk1.box" # Manage /etc/hosts on host and VMs # config.hostmanager.enabled = false # config.hostmanager.manage_host = true # config.hostmanager.include_offline = true # config.hostmanager.ignore_private_ip = false config.vm.define :master do |master| master.vm.provider :virtualbox do |v| v.name = "mapr-node1" v.customize ["modifyvm", :id, "--memory", "32768"] unless File.exist?('datadisk1.vdi') v.customize ['createhd', '--filename', 'datadisk1.vdi', '--size', 50 * 1024] end v.customize ['storageattach', :id, '--storagectl', 'SATAController', '--port', 1, '-- device', 0, '--type', 'hdd', '--medium', 'datadisk1.vdi'] end master.vm.network :private_network, ip: "10.211.55.108" master.vm.hostname = "mapr-node1" master.vm.network "forwarded_port", guest: 9443, host: 9443 master.vm.network "forwarded_port", guest: 22, host: 9444 master.vm.provision :shell, :inline => $hosts_script master.vm.provision :shell, :inline => $master_script end config.vm.define :slave1 do |slave1| slave1.vm.box = "precise64" slave1.vm.provider :virtualbox do |v| v.name = "mapr-node2" v.customize ["modifyvm", :id, "--memory", "32768"] unless File.exist?('datadisk2.vdi') v.customize ['createhd', '--filename', 'datadisk2.vdi', '--size', 50 * 1024] end v.customize ['storageattach', :id, '--storagectl', 'SATAController', '--port', 1, '-- device', 0, '--type', 'hdd', '--medium', 'datadisk2.vdi'] end slave1.vm.network :private_network, ip: "10.211.55.109" slave1.vm.hostname = "mapr-node2" slave1.vm.provision :shell, :inline => $hosts_script end config.vm.define :slave2 do |slave2| slave2.vm.box = "precise64" slave2.vm.provider :virtualbox do |v| v.name = "mapr-node3" v.customize ["modifyvm", :id, "--memory", "32768"]
  • 9. unless File.exist?('datadisk3.vdi') v.customize ['createhd', '--filename', 'datadisk3.vdi', '--size', 50 * 1024] end v.customize ['storageattach', :id, '--storagectl', 'SATAController', '--port', 1, '-- device', 0, '--type', 'hdd', '--medium', 'datadisk3.vdi'] end slave2.vm.network :private_network, ip: "10.211.55.110" slave2.vm.hostname = "mapr-node3" slave2.vm.provision :shell, :inline => $hosts_script end config.vm.define :slave3 do |slave3| slave3.vm.box = "precise64" slave3.vm.provider :virtualbox do |v| v.name = "mapr-node4" v.customize ["modifyvm", :id, "--memory", "32768"] unless File.exist?('datadisk4.vdi') v.customize ['createhd', '--filename', 'datadisk4.vdi', '--size', 50 * 1024] end v.customize ['storageattach', :id, '--storagectl', 'SATAController', '--port', 1, '-- device', 0, '--type', 'hdd', '--medium', 'datadisk4.vdi'] end slave3.vm.network :private_network, ip: "10.211.55.111" slave3.vm.hostname = "mapr-node4" slave3.vm.provision :shell, :inline => $hosts_script end config.vm.define :slave4 do |slave4| slave4.vm.box = "precise64" slave4.vm.provider :virtualbox do |v| v.name = "mapr-node5" v.customize ["modifyvm", :id, "--memory", "32768"] unless File.exist?('datadisk5.vdi') v.customize ['createhd', '--filename', 'datadisk5.vdi', '--size', 50 * 1024] end v.customize ['storageattach', :id, '--storagectl', 'SATAController', '--port', 1, '-- device', 0, '--type', 'hdd', '--medium', 'datadisk5.vdi'] end slave4.vm.network :private_network, ip: "10.211.55.112" slave4.vm.hostname = "mapr-node5" slave4.vm.provision :shell, :inline => $hosts_script end end