Skip to content

Commit 3c82f09

Browse files
committed
Added vagrant file section for 2nd node (kafka_workernode_01).
1 parent 0ed9947 commit 3c82f09

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

Vagrantfile

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,34 @@ Vagrant.configure("2") do |config|
2525
end # End of "kafka_node_01.vm.provider"
2626
end # End of config.vm.define "kafka_node_01"
2727

28+
29+
30+
# Define Kafka worker node
31+
config.vm.define "kafka_workernode_01" do |kafka_workernode_01|
32+
kafka_workernode_01.vm.synced_folder "./vagrant", "/vagrant"
33+
#kafka_node_01.vm.box = "ol7-latest"
34+
kafka_workernode_01.vm.box = "ol74"
35+
kafka_workernode_01.vm.hostname = 'kafka_workernode_01'
36+
#kafka_node_01.vm.box_url = "https://yum.oracle.com/boxes/oraclelinux/latest/ol7-latest.box"
37+
kafka_workernode_01.vm.box_url = "http://yum.oracle.com/boxes/oraclelinux/ol74/ol74.box"
38+
kafka_workernode_01.vm.network :"private_network", type: "dhcp"
39+
kafka_workernode_01.vm.network "forwarded_port", guest: 9092, host: 9092, protocol: "tcp"
40+
kafka_workernode_01.vm.network "forwarded_port", guest: 9021, host: 9021, protocol: "tcp"
41+
kafka_workernode_01.vm.network "forwarded_port", guest: 8083, host: 8083, protocol: "tcp"
42+
kafka_workernode_01.vm.network "forwarded_port", guest: 8082, host: 8082, protocol: "tcp"
43+
kafka_workernode_01.vm.network "forwarded_port", guest: 8081, host: 8081, protocol: "tcp"
44+
kafka_workernode_01.vm.network "forwarded_port", guest: 2181, host: 2181, protocol: "tcp"
45+
kafka_workernode_01.vm.provider :virtualbox do |v|
46+
v.customize ["modifyvm", :id, "--memory", 1024]
47+
v.customize ["modifyvm", :id, "--cpus", "2"]
48+
v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
49+
v.customize ["modifyvm", :id, "--usb", "off"]
50+
v.customize ["modifyvm", :id, "--audio", "none"]
51+
v.customize ["modifyvm", :id, "--name", "kafka_node_01"]
52+
end # End of "kafka_workernode_01.vm.provider"
53+
end # End of config.vm.define "kafka_workernode_01"
54+
55+
2856
# Set auto_update to false
2957
# This will not automatically update the guest additions on VM boot
3058
# Set to "true" if you want auto-updates
@@ -37,7 +65,7 @@ Vagrant.configure("2") do |config|
3765
ansible.verbose = "v"
3866
ansible.playbook = "ansible-playbook.yml"
3967
ansible.groups = {
40-
"kafkabrokers" => ["kafka_node_01"],
68+
"kafkabrokers" => ["kafka_node_01", "kafka_workernode_01"],
4169
"kafkabrokers:vars" => {"variable1" => "example1",
4270
"variable2" => "example2"}
4371
}

0 commit comments

Comments
 (0)