Creating two virtual networks in Vagrant -


I need 2 virtual passionate networks to talk to each other through a 'gateway'. I am modeling multi-level applications that will be deployed on multiple servers. I need something like this:

  DB-Server - - DB-Server | | - Distributor **** Distributor - | | Make app-server-apple-server   

db-server , app-server and distributor private network. This network should be accessible from the other virtual network's distributor . I have to do Vagrantfile :

  VAGRANTFILE_API_VERSION = "2" Vagrant.configure (VAGRANTFILE_API_VERSION). Config | Config.vm.box = "ubuntu / trusty64" # db-server config.vm.define "db" do | Db | Db.vm.hostname = "db" db.vm.provider to "virtualbox". V | V.customize ["modifyvm": id, "--cpus", "1"] v.customize ["modifyvm", id, "--memory", "512"] end db.vm.network "private_network "," IP ":" 192.168.10.11 "and # application server config.vm.define" app ". App | App.vm.hostname = "app" app. Vm.provider "virtualbox" do | V | V.customize ["modifyvm": id, "--cpus", "1"] v.customize ["modifyvm", id, "--memory", "512"] end app.vm.network "private_network" ", IP:" 192.168.10.12 "end # distributor server config.vm.define" distributor ". Distributor | Distributor.vm.hostname = "Distributor" Distributor. Vm.provider do "virtualbox". V | V.customize ["modifyvm": id, "--cpus", "1"] v.customize ["modifyvm", id, "--memory", "512"] End distributor. Vm.network "private_network", IP: "192.168.10.13" and end   

How do I configure my distributor ? The only way I found that is to add smth to the config.vm.network "public_network", IP: "192.168.10.14" .
Which IP should I assign to Distributor 2? Can I specify another network machine in the same code?

You can extrapolate (additional details there):

  Db-server-1 = [192.168.1.3] [192.168.2.3] = DB-Server-2 [192.168.1.1] = Distributor = [192.168.2.1] App-server-1 = [19 2.168.1.5] [1 9 0268.2.5] = App-server-2   

working awards file

copied & amp; Pasted: VAGRANTFILE_API_VERSION = "2" Warrant. Configure (VAGRANTFILE_API_VERSION). Configure | Config.vm.provider "libvirt" config.vm.define "rhel7_minion" do | Rhel7_minion | Rhel7_minion.vm.box = "uvsmtid / centos-7.1-1503-gnome" rhel7_minion.vm.synced_folder '.', '/ Vagrant', disabled: true rhel7_minion.vm.network 'private_network' ,: libvirt__network_name = & gt; 'Primary_vagrant_private_net', IP: '192.168.1.2' ,: libvirt__netmask = & gt; '255.255.255.0' ,: libvirt__forward_mode = & gt; 'Route' ,: libvirt__dhcp_enabled = & gt; Do the true end config.vm.define "rhel5_minion". Rhel5_minion | Rhel5_minion.vm.box = "uvsmtid / centos-5.5-min" rhel5_minion.vm.synced_folder '.', '/ Vagrant', disabled: true rhel5_minion.vm.network 'private_network' ,: libvirt__network_name = & gt; 'Secondary_vagrant_private_net', IP: '192.168.2.3' ,: libvirt__netmask = & gt; '255.255.255.0' ,: libvirt__forward_mode = & gt; 'Route' ,: libvirt__dhcp_enabled = & gt;

  • Distributor may be your physical host.
  • You should change the Top half > diagram of rhel7_minion = & gt; db-server-1 and rhel5_minion = & gt; db-server-2 .
  • Find lower below the figure; Server app-server-1 and app-server-2 . to paste (and modify names with IP)

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -