-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
35 lines (28 loc) · 1.24 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# -*- mode: ruby -*-
# vi: set ft=ruby :
# required plugins
# vagrant-hostmanager
# vagrant-disksize
VAGRANTFILE_API_VERSION = "2"
cluster = {
"hadoop01" => { :ip1 => "192.168.157.11", :ip2 => "192.168.197.11", :cpus => 2, :mem => 8196, :script => "deploy.sh"},
#"hadoop02" => { :ip1 => "192.168.157.12", :ip2 => "192.168.197.12", :cpus => 2, :mem => 4096, :script => "deploy.sh"},
#"hadoop03" => { :ip1 => "192.168.157.13", :ip2 => "192.168.197.13", :cpus => 2, :mem => 4096, :script => "deploy.sh"}
}
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
cluster.each_with_index do |(hostname, info), index|
config.hostmanager.enabled = true
config.vm.define hostname do |cfg|
cfg.vm.provider :virtualbox do |vb, override|
config.vm.box = "ubuntu/xenial64"
config.vm.synced_folder ".", "/vagrant"
config.disksize.size = '100GB'
override.vm.network :private_network, ip: "#{info[:ip1]}"
override.vm.hostname = hostname
vb.name = hostname
vb.customize ["modifyvm", :id, "--memory", info[:mem], "--cpus", info[:cpus], "--hwvirtex", "on"]
end # end provider
cfg.vm.provision :shell, path: info[:script], keep_color: "true"
end # end config
end # end cluster
end