5. Running multiple vagrant hosts

Source: Internet
Author: User

Note: The preferred network connection mode for multiple virtual machine launches is Host-only networking


1. One of the simplest configurations

Vagrant.configure (2) Do |config| Config.vm.box = "CentOS" Config.vm.box_url = "G:/vagrant-centos-6.7.box" config.ssh.username = "vagrant" Config.ssh.pas    Sword = "vagrant" config.vm.define "web" do |web|    Web.vm.network "Private_network", IP: "192.168.33.10" End Config.vm.define "db" Do |db| Db.vm.network "Private_network", IP: "192.168.33.11" EndEnd


2. Specific configuration for each virtual machine

Vagrant.configure (2)  do |config|  config.vm.define  "Web"  do |web|     web.vm.box =  "CentOS" web.vm.box_url =  "C:/me/vagrant-centos-6.7.box" web.vm.hostname =  "CentOS"     web.vm.network  "Private_network",  ip:   "192.168.56.10" web.vm.provider  "VirtualBox"  do |v|  v.gui = false   v.name =  "CentOS"   v.cpus =  "1"   v.memory =  " 2048 "end  end    config.vm.define " DB " do |db|     db.vm.box =  "Ubuntu"     db.vm.box_url =  "c:/me/ Ubuntu-14.04-amd64.box "db.vm.hostname = " Ubuntu "    db.vm.network " Private_ Network ", ip: " 192.168.56.11 "db.vm.provider " VirtualBox " do |v|  v.gui  = false  v.name =  "UBuntu-1 "  v.cpus = " 1 "  v.memory = " 2048 "end  endend 


3. Multi-Machine management

3.1 Viewing status

The Vagrant status==> output is as follows current machine States:web running (VirtualBox) DB run Ning (VirtualBox) This environment represents multiple VMs. The VMs is all listedabove with their current state. For more information about a SPECIFICVM, run ' vagrant status NAME '.


3.2 Reload Configuration

Vagrant Reload Web db


This article is from "Mr. Peach" blog, please be sure to keep this source http://peach3412.blog.51cto.com/12037226/1850723

5. Running multiple vagrant hosts

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.