Skip to content

Commit

Permalink
Scale out +1 worker node
Browse files Browse the repository at this point in the history
- For MySQL InnoDBCluster instances distributed per node.

Signed-off-by: flavono123 <flavono123@gmail.com>
  • Loading branch information
flavono123 committed Jun 8, 2022
1 parent 346e7b8 commit 34d1a79
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,20 @@ Vagrant.configure('2') do |config|
worker.vm.hostname = 'cluster1-worker2'
worker.vm.network :private_network, ip: '192.168.1.4'
worker.vm.network :forwarded_port, guest: 22, host: 2224, id: 'ssh'
end

config.vm.define 'cluster1-worker3' do |worker|
worker.vm.provider 'virtualbox' do |vbox|
vbox.name = 'cluster1-worker3'
vbox.cpus = 2
vbox.memory = 2048
end

worker.vm.hostname = 'cluster1-worker3'
worker.vm.network :private_network, ip: '192.168.1.5'
worker.vm.network :forwarded_port, guest: 22, host: 2225, id: 'ssh'

# All VMs are up, after cluster1-worker2 is up, provisioning the entire VMs at once
# All VMs are up, after cluster1-worker3 is up, provisioning the entire VMs at once
worker.vm.provision 'ansible' do |ansible|
ansible.playbook = 'provisioning/cluster-nodes.yaml'
ansible.inventory_path = 'provisioning/cluster1_nodes'
Expand Down
2 changes: 2 additions & 0 deletions provisioning/cluster1_nodes
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
cluster1-master1
cluster1-worker1
cluster1-worker2
cluster1-worker3

[controlplane]
cluster1-master1

[nodes]
cluster1-worker1
cluster1-worker2
cluster1-worker3
3 changes: 3 additions & 0 deletions provisioning/host_vars/cluster1-worker3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
ansible_port: 2225
ansible_ssh_private_key_file: .vagrant/machines/cluster1-worker3/virtualbox/private_key
1 change: 1 addition & 0 deletions provisioning/roles/dns/tasks/configure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
192.168.1.2 cluster1-master1
192.168.1.3 cluster1-worker1
192.168.1.4 cluster1-worker2
192.168.1.5 cluster1-worker3

0 comments on commit 34d1a79

Please sign in to comment.