Vagrant 使用简介

2017-12-16  本文已影响7人  天玑云象

Quick Start

vagrant init ubuntu/xenial64

Change Hostname

config.vm.hostname = 'master'

Use bridge/public network

config.vm.network "public_network"

Change VM memory size

config.vm.provider "virtualbox" do |vb|
  vb.memory = "1024"
end

Disable box update

config.vm.box_check_update = false

Setup cluster with multi VMs

config.vm.define "master" do |master|
    master.vm.box = 'ubuntu/xenial64'
    master.vm.hostname = 'master'
end

config.vm.define "worker1" do |worker1|
    worker1.vm.box = 'ubuntu/xenial64'
    worker1.vm.hostname = 'worker1'
end

config.vm.define "worker2" do |worker2|
    worker2.vm.box = 'ubuntu/xenial64'
    worker2.vm.hostname = 'worker2'
end

config.vm.define "dev" do |dev|
    dev.vm.box = 'ubuntu/xenial64'
    dev.vm.hostname = 'dev'
end
上一篇下一篇

猜你喜欢

热点阅读