美文网首页
Vagrant 使用简介

Vagrant 使用简介

作者: 天玑云象 | 来源:发表于2017-12-16 21:15 被阅读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
    

    相关文章

      网友评论

          本文标题:Vagrant 使用简介

          本文链接:https://www.haomeiwen.com/subject/mcdewxtx.html