-
Notifications
You must be signed in to change notification settings - Fork 25
/
Vagrantfile
27 lines (24 loc) · 929 Bytes
/
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
Vagrant.configure("2") do |config|
# Cluster Nodes
cluster_nodes=3
(1..cluster_nodes).each do |i|
config.vm.define "kafka-#{i}" do |node|
node.vm.box = "ubuntu/focal64"
node.vm.hostname = "kafka#{i}"
node.vm.network :private_network, ip: "192.168.56.10#{i}"
# expose JMX port
node.vm.network "forwarded_port", guest: 9999, host: "1000#{i}", protocol: "tcp"
# node.vm.provision :hosts, :sync_hosts => true
end
end
# Setting CPU and Memory for All machines
config.vm.provider "virtualbox" do |vb|
vb.gui = false
vb.memory = "1024"
vb.cpus = 1
vb.customize [ "modifyvm", :id, "--uartmode1", "disconnected" ] # used for wsl2
end
# SSH config to use your local ssh key for auth instead of username/password
config.ssh.insert_key = false
config.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "~/.ssh/authorized_keys"
end