How to set up multiple machines with Vagrant (also know as "Multi-Machine")
Setting up multiple machines / boxes in vagrant is easy! In this video I will talk you through setting up three new boxes running Ubuntu 14.04 (Trusty) 64-bit inside one single vagrant configuration.
Essentially you have your Vagrantfile in your working directory and all you have to do is edit that file. We cover a really basic installation but you might want to add other settings into each boxes config such as private networking or port forwarding. I would highly recommend the official Vagrant documentation which can be found here: docs.vagrantup....
Here is the direct vagrant documentation for what we cover today: docs.vagrantup....
Here is a list of commands used in the video (in cronelodigcal order):
1. vagrant init
2. sudo nano Vagrantfile
3. Press Ctrl+o (to save) and then Ctrl+x (to exit)
4. vagrant up
5. vagrant ssh lb1
6. vagrant ssh web1
7. vagrant ssh web2
Here is the snippet of code I write in the Vagrant file:
config.vm.define "lb1" do |lb1|
lb1.vm.box = "ubuntu/trusty64"
end
config.vm.define "web1" do |web1|
web1.vm.box = "ubuntu/trusty64"
end
config.vm.define "web2" do |web2|
web2.vm.box = "ubuntu/trusty64"
end
You can run any normal vagrant command with each machine such as:
- vagrant ssh lb1
- vagrant halt web2
- vagrant up web2
If you are interested in using other Operating Systems rather than Ubuntu then check out atlas.hashicor... which has a great search feature with lots of box images such as Cent OS, Debian and some exciting images that include puppet, chef and docker.
DISCLAIMER: I take no responsibility in any damage to your machine this video may cause.
Негізгі бет Vagrant: How to set up multiple boxes
Пікірлер: 20