devops's docs

vagrant: 3.3.0 在一个目录中创建多主机

1. Why we need multiple VMs?

The problem of IT in today that we have to faced is more and more access pressure, for solving this, cluster is the best way. So that's why we need multiple vms, as metioned above, sometimes we need a web cluster to test.

2. How to get multiple vms in vagrant?

configure like this in Vagrantfile

Vagrant.configure("2") do |config| = "d:\IMAGE-ISO\"
  config.vm.define "node01" do |node01|
    node01.vm.hostname = "node01" "private_network", ip: ""

  config.vm.define "node02" do |node02|
    node02.vm.hostname = "node02" "private_network", ip: ""

3. How to manage multiple vms?

# get all vms up
vagrant up

# only get one vm up
vagrant up hostname

# how to ssh vms
vagrant ssh hostname