![]() ![]() #Vagrant centos updateIt will update the /etc/hosts file on each virtual server, and on the host-system (the Mac).Īlso note that with a multi-vm Vagrantfile like this, we can refer to each vm by its shorthand name, or leave it out to operate on all vms: vagrant up # brings up all four machines One can achieve this with manually editing /etc/hosts on every system, but it’s much easier to enable the hostmanager plugin. ![]() This means that from the app-server, we can hardcode the DB server host to be ‘DB-01’, and it will work fine in both local dev and live servers. We want to use nice short hostnames for addressing the servers instead of IP-addresses, and these happen to be the same in production. The most exotic part of our Vagrant configuration file is the hostmanager plugin. The linked box is a “minimal” CentOS distribution, meaning that there’s next to no packages installed on it already. ![]() I also toyed around with creating our own base-box from the official CentOS distribution, but in the end the ready Vagrant box came with some default network configuration and VirtualBox additions ready to use. I found the starting point for this VirtualBox image on. Web.vm.network "forwarded_port", guest: 8080, host: 8080 ![]() # do `vagrant hostmanager` to refresh the /etc/hosts files #Vagrant centos install# do vagrant plugin install vagrant-hostmanager We can have Vagrant set this up for us by creating a Vagrantfile with this multi-machine configuration:
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |