This repository has been archived by the owner on Nov 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 76
/
Copy pathVagrantfile
51 lines (50 loc) · 1.61 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Vagrant.require_version ">= 1.4.3"
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
numNodes = 4
r = numNodes..1
(r.first).downto(r.last).each do |i|
config.vm.define "node#{i}" do |node|
node.vm.box = "centos65"
node.vm.box_url = "https://github.com/2creatives/vagrant-centos/releases/download/v6.5.1/centos65-x86_64-20131205.box"
node.vm.provider "virtualbox" do |v|
v.name = "node#{i}"
v.customize ["modifyvm", :id, "--memory", "2048"]
end
if i < 10
node.vm.network :private_network, ip: "10.211.55.10#{i}"
else
node.vm.network :private_network, ip: "10.211.55.1#{i}"
end
node.vm.hostname = "node#{i}"
node.vm.provision "shell", path: "scripts/setup-centos.sh"
node.vm.provision "shell" do |s|
s.path = "scripts/setup-centos-hosts.sh"
s.args = "-t #{numNodes}"
end
if i == 2
node.vm.provision "shell" do |s|
s.path = "scripts/setup-centos-ssh.sh"
s.args = "-s 3 -t #{numNodes}"
end
end
if i == 1
node.vm.provision "shell" do |s|
s.path = "scripts/setup-centos-ssh.sh"
s.args = "-s 2 -t #{numNodes}"
end
end
node.vm.provision "shell", path: "scripts/setup-java.sh"
node.vm.provision "shell", path: "scripts/setup-hadoop.sh"
node.vm.provision "shell" do |s|
s.path = "scripts/setup-hadoop-slaves.sh"
s.args = "-s 3 -t #{numNodes}"
end
node.vm.provision "shell", path: "scripts/setup-spark.sh"
node.vm.provision "shell" do |s|
s.path = "scripts/setup-spark-slaves.sh"
s.args = "-s 3 -t #{numNodes}"
end
end
end
end